diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2006-12-14 15:49:41 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2006-12-14 15:49:41 +0000 |
commit | 3b6acc93bf03bae282c71d4f63a9639b1bb7dc38 (patch) | |
tree | 82cc7e6c8d5f71213c24e4e593252edb96aacbac /python/libxml.py | |
parent | 602f2bd01a50e20eabf4e2e7700e4bda1c627457 (diff) | |
download | libxml2-3b6acc93bf03bae282c71d4f63a9639b1bb7dc38.tar.gz |
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
Diffstat (limited to 'python/libxml.py')
-rw-r--r-- | python/libxml.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/python/libxml.py b/python/libxml.py index 4c9fe92f..988a1662 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -1,10 +1,20 @@ 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. # class treeError(libxmlError): |