diff options
author | Fred Drake <fdrake@acm.org> | 2000-12-16 01:45:11 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-12-16 01:45:11 (GMT) |
commit | 95b4ec5fbe039f1b6877d74fffc6564a42efe1cb (patch) | |
tree | f6d0fcfbec454e1bc38f26d3b874dc053571a920 /Lib/xml | |
parent | 1402ab2cb98563a548d03139bb2aa269965db342 (diff) | |
download | cpython-95b4ec5fbe039f1b6877d74fffc6564a42efe1cb.zip cpython-95b4ec5fbe039f1b6877d74fffc6564a42efe1cb.tar.gz cpython-95b4ec5fbe039f1b6877d74fffc6564a42efe1cb.tar.bz2 |
Do not assume that types.UnicodeType exists; we might be running in an old
version of Python. ;-(
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/sax/saxutils.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index 83c779f..e592f2a 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. |