]> granicus.if.org Git - python/commitdiff
Do not assume that types.UnicodeType exists; we might be running in an old
authorFred Drake <fdrake@acm.org>
Sat, 16 Dec 2000 01:45:11 +0000 (01:45 +0000)
committerFred Drake <fdrake@acm.org>
Sat, 16 Dec 2000 01:45:11 +0000 (01:45 +0000)
version of Python.  ;-(

Lib/xml/sax/saxutils.py

index 83c779fc957d1b3c9b14b504bfcf1cb56d6f5062..e592f2a1d9020967ec45b60228cc90f4027540a2 100644 (file)
@@ -7,7 +7,11 @@ import os, urlparse, urllib, types
 import handler
 import xmlreader
 
-_StringTypes = [types.StringType, types.UnicodeType]
+try:
+    _StringTypes = [types.StringType, types.UnicodeType]
+except AttributeError:
+    _StringTypes = [types.StringType]
+
 
 def escape(data, entities={}):
     """Escape &, <, and > in a string of data.