Ticket #42069: patch-drv_libxml2.py.diff

File patch-drv_libxml2.py.diff, 851 bytes (added by zpeeters@…, 11 years ago)
  • drv_libxml2.py

    old new  
    1 # -*- coding: iso-8859-1 -*-
     1# -*- coding: utf-8 -*-
    22""" A SAX2 driver for libxml2, on top of it's XmlReader API
    33
    44USAGE
     
    3434
    3535"""
    3636
    37 __author__  = u"Stéphane Bidoul <sbi@skynet.be>"
     37__author__  = "Stéphane Bidoul <sbi@skynet.be>"
    3838__version__ = "0.3"
    3939
    4040import codecs
    41 from types import StringType, UnicodeType
    42 StringTypes = (StringType,UnicodeType)
     41import builtins
     42StringTypes = (builtins.str)
    4343
    4444from xml.sax._exceptions import *
    4545from xml.sax import xmlreader, saxutils
     
    6565
    6666try:
    6767    import libxml2
    68 except ImportError, e:
     68except ImportError as e:
    6969    raise SAXReaderNotAvailable("libxml2 not available: " \
    7070                                "import error was: %s" % e)
    7171