mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
apparently id() sometimes generate negative values and %X outputs -XXXX
* python/generator.py python/libxml.py: apparently id() sometimes generate negative values and %X outputs -XXXX :-( Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
Thu Dec 14 16:52:34 CET 2006 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* python/generator.py python/libxml.py: apparently id() sometimes
|
||||
generate negative values and %X outputs -XXXX :-(
|
||||
|
||||
Mon Dec 4 10:30:25 CET 2006 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* parser.c include/libxml/tree.h: patch from Michael Day on standalone
|
||||
|
@ -1055,7 +1055,7 @@ def buildWrappers():
|
||||
classes_ancestor[classname] == "xmlNode":
|
||||
classes.write(" def __repr__(self):\n")
|
||||
format = "<%s (%%s) object at 0x%%x>" % (classname)
|
||||
classes.write(" return \"%s\" %% (self.name, long(id (self)))\n\n" % (
|
||||
classes.write(" return \"%s\" %% (self.name, long(pos_id (self)))\n\n" % (
|
||||
format))
|
||||
else:
|
||||
txt.write("Class %s()\n" % (classname))
|
||||
|
@ -1,9 +1,19 @@
|
||||
import libxml2mod
|
||||
import types
|
||||
import sys
|
||||
|
||||
# The root of all libxml2 errors.
|
||||
class libxmlError(Exception): pass
|
||||
|
||||
#
|
||||
# id() is sometimes negative ...
|
||||
#
|
||||
def pos_id(o):
|
||||
i = id(o)
|
||||
if (i < 0):
|
||||
return (sys.maxint - i)
|
||||
return i
|
||||
|
||||
#
|
||||
# Errors raised by the wrappers when some tree handling failed.
|
||||
#
|
||||
|
Reference in New Issue
Block a user