summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-02-16 22:13:48 (GMT)
committerFred Drake <fdrake@acm.org>2001-02-16 22:13:48 (GMT)
commitf5d2fdf164c56d472ce45cefdd8e848b83696b27 (patch)
tree42fd385c1e67b0b301355ccbfbefed5e33114412 /Tools
parent7df9c60b8a263d8ff9dbed096ee681b36c2ba2ad (diff)
downloadcpython-f5d2fdf164c56d472ce45cefdd8e848b83696b27.zip
cpython-f5d2fdf164c56d472ce45cefdd8e848b83696b27.tar.gz
cpython-f5d2fdf164c56d472ce45cefdd8e848b83696b27.tar.bz2
Hack to make this still work with Python 1.5.2. ;-(
Diffstat (limited to 'Tools')
-rw-r--r--Tools/idle/PyParse.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/idle/PyParse.py b/Tools/idle/PyParse.py
index ac68caa..a512356 100644
--- a/Tools/idle/PyParse.py
+++ b/Tools/idle/PyParse.py
@@ -105,6 +105,11 @@ for ch in "\"'\\\n#":
_tran = string.join(_tran, '')
del ch
+try:
+ UnicodeType = type(unicode(""))
+except NameError:
+ UnicodeType = None
+
class Parser:
def __init__(self, indentwidth, tabwidth):
@@ -113,7 +118,7 @@ class Parser:
def set_str(self, str):
assert len(str) == 0 or str[-1] == '\n'
- if type(str) == type(u""):
+ if type(str) is UnicodeType:
# The parse functions have no idea what to do with Unicode, so
# replace all Unicode characters with "x". This is "safe"
# so long as the only characters germane to parsing the structure