equal
deleted
inserted
replaced
1 # This patch has been submitted upstream but not yet accepted: |
|
2 # https://bugzilla.gnome.org/show_bug.cgi?id=734005 |
|
3 |
|
4 --- libxml2-2.9.1/python/drv_libxml2.py.~1~ 2009-07-30 08:24:34.000000000 -0700 |
|
5 +++ libxml2-2.9.1/python/drv_libxml2.py 2014-07-30 10:43:36.655237802 -0700 |
|
6 @@ -38,8 +38,11 @@ |
|
7 __version__ = "0.3" |
|
8 |
|
9 import codecs |
|
10 -from types import StringType, UnicodeType |
|
11 -StringTypes = (StringType,UnicodeType) |
|
12 +try: |
|
13 + from types import StringType, UnicodeType |
|
14 + StringTypes = (StringType,UnicodeType) |
|
15 +except: |
|
16 + StringTypes = (bytes,str) |
|
17 |
|
18 from xml.sax._exceptions import * |
|
19 from xml.sax import xmlreader, saxutils |
|
20 @@ -65,7 +68,7 @@ |
|
21 |
|
22 try: |
|
23 import libxml2 |
|
24 -except ImportError, e: |
|
25 +except ImportError as e: |
|
26 raise SAXReaderNotAvailable("libxml2 not available: " \ |
|
27 "import error was: %s" % e) |
|
28 |
|