summaryrefslogtreecommitdiff
path: root/python/libxml.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/libxml.py')
-rw-r--r--python/libxml.py10
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):