[Python-checkins] CVS: python/dist/src/Tools/idle PyParse.py,1.7,1.8
Fred L. Drake
fdrake@users.sourceforge.net
Fri, 16 Feb 2001 14:13:50 -0800
Update of /cvsroot/python/python/dist/src/Tools/idle
In directory usw-pr-cvs1:/tmp/cvs-serv24996
Modified Files:
PyParse.py
Log Message:
Hack to make this still work with Python 1.5.2. ;-(
Index: PyParse.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/PyParse.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** PyParse.py 2000/10/06 23:09:00 1.7
--- PyParse.py 2001/02/16 22:13:48 1.8
***************
*** 106,109 ****
--- 106,114 ----
del ch
+ try:
+ UnicodeType = type(unicode(""))
+ except NameError:
+ UnicodeType = None
+
class Parser:
***************
*** 114,118 ****
def set_str(self, str):
assert len(str) == 0 or str[-1] == '\n'
! if type(str) == type(u""):
# The parse functions have no idea what to do with Unicode, so
# replace all Unicode characters with "x". This is "safe"
--- 119,123 ----
def set_str(self, str):
assert len(str) == 0 or str[-1] == '\n'
! 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"