summaryrefslogtreecommitdiffstats
path: root/Lib/xml
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/sax/saxutils.py6
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.