summaryrefslogtreecommitdiff
path: root/python/libxml.py
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2013-04-02 10:27:57 +0800
committerDaniel Veillard <veillard@redhat.com>2013-04-02 10:27:57 +0800
commitbf4a8f0ea8579f05eea2e6f43df73b2a239d41b3 (patch)
treef40665cd9abd5d9d2615cafb4deb45d746a01486 /python/libxml.py
parent4d7a32959b49dda1b2ba9aea83e5d5886014ac25 (diff)
downloadlibxml2-bf4a8f0ea8579f05eea2e6f43df73b2a239d41b3.tar.gz
Fix python bindings with versions older than 2.7
Need fixing on the Capsule usage, the lack of PyBytes, lack of io module and the way to access exception details.
Diffstat (limited to 'python/libxml.py')
-rw-r--r--python/libxml.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/libxml.py b/python/libxml.py
index 117de824..e507e0fa 100644
--- a/python/libxml.py
+++ b/python/libxml.py
@@ -77,7 +77,9 @@ class ioWrapper:
ret = self.__io.read()
else:
ret = self.__io.read(len)
- except Exception as e:
+ except Exception:
+ import sys
+ e = sys.exc_info()[1]
print("failed to read from Python:", type(e))
print("on IO:", self.__io)
self.__io == None