1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-04 08:02:34 +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:
Daniel Veillard
2006-12-14 15:49:41 +00:00
parent 602f2bd01a
commit 3b6acc93bf
3 changed files with 16 additions and 1 deletions

View File

@ -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.
#