From: Fred Drake Date: Sat, 16 Dec 2000 01:45:11 +0000 (+0000) Subject: Do not assume that types.UnicodeType exists; we might be running in an old X-Git-Tag: v2.1a1~546 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95b4ec5fbe039f1b6877d74fffc6564a42efe1cb;p=python Do not assume that types.UnicodeType exists; we might be running in an old version of Python. ;-( --- diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index 83c779fc95..e592f2a1d9 100644 --- a/Lib/xml/sax/saxutils.py +++ b/Lib/xml/sax/saxutils.py @@ -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.