From 95b4ec5fbe039f1b6877d74fffc6564a42efe1cb Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Sat, 16 Dec 2000 01:45:11 +0000 Subject: [PATCH] Do not assume that types.UnicodeType exists; we might be running in an old version of Python. ;-( --- Lib/xml/sax/saxutils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index 83c779fc957..e592f2a1d90 100644 --- a/Lib/xml/sax/saxutils.py +++ b/Lib/xml/sax/saxutils.py @@ -7,7 +7,11 @@ 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.