Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95b4ec5

Browse files
committed
Do not assume that types.UnicodeType exists; we might be running in an old
version of Python. ;-(
1 parent 1402ab2 commit 95b4ec5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Lib/xml/sax/saxutils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
import handler
88
import xmlreader
99

10-
_StringTypes = [types.StringType, types.UnicodeType]
10+
try:
11+
_StringTypes = [types.StringType, types.UnicodeType]
12+
except AttributeError:
13+
_StringTypes = [types.StringType]
14+
1115

1216
def escape(data, entities={}):
1317
"""Escape &, <, and > in a string of data.

0 commit comments

Comments
 (0)