--- embedaddon/libxml2/python/drv_libxml2.py 2012/02/21 23:38:00 1.1.1.1 +++ embedaddon/libxml2/python/drv_libxml2.py 2014/06/15 20:01:54 1.1.1.1.4.1 @@ -34,13 +34,21 @@ TODO """ -__author__ = u"Stéphane Bidoul " +__author__ = "Stéphane Bidoul " __version__ = "0.3" +import sys import codecs -from types import StringType, UnicodeType -StringTypes = (StringType,UnicodeType) +if sys.version < "3": + __author__ = codecs.unicode_escape_decode(__author__)[0] + + from types import StringType, UnicodeType + StringTypes = (StringType,UnicodeType) + +else: + StringTypes = (str) + from xml.sax._exceptions import * from xml.sax import xmlreader, saxutils from xml.sax.handler import \ @@ -65,7 +73,7 @@ def _d(s): try: import libxml2 -except ImportError, e: +except ImportError as e: raise SAXReaderNotAvailable("libxml2 not available: " \ "import error was: %s" % e)