mirror of https://github.com/python/cpython.git
Do not assume that types.UnicodeType exists; we might be running in an old
version of Python. ;-(
This commit is contained in:
parent
1402ab2cb9
commit
95b4ec5fbe
|
@ -7,7 +7,11 @@
|
||||||
import handler
|
import handler
|
||||||
import xmlreader
|
import xmlreader
|
||||||
|
|
||||||
_StringTypes = [types.StringType, types.UnicodeType]
|
try:
|
||||||
|
_StringTypes = [types.StringType, types.UnicodeType]
|
||||||
|
except AttributeError:
|
||||||
|
_StringTypes = [types.StringType]
|
||||||
|
|
||||||
|
|
||||||
def escape(data, entities={}):
|
def escape(data, entities={}):
|
||||||
"""Escape &, <, and > in a string of data.
|
"""Escape &, <, and > in a string of data.
|
||||||
|
|
Loading…
Reference in New Issue