Author: guido.van.rossum
Date: Wed Nov 21 21:07:54 2007
New Revision: 59097

Modified:
   python/branches/py3k/Lib/idlelib/PyParse.py
Log:
Fix an issue with str.translate() in IDLE -- str.translate() only accepts
a dict argument now.


Modified: python/branches/py3k/Lib/idlelib/PyParse.py
==============================================================================
--- python/branches/py3k/Lib/idlelib/PyParse.py (original)
+++ python/branches/py3k/Lib/idlelib/PyParse.py Wed Nov 21 21:07:54 2007
@@ -94,15 +94,16 @@
 # Build translation table to map uninteresting chars to "x", open
 # brackets to "(", and close brackets to ")".
 
-_tran = ['x'] * 256
+_tran = {}
+for i in range(256):
+    _tran[i] = 'x'
 for ch in "({[":
     _tran[ord(ch)] = '('
 for ch in ")}]":
     _tran[ord(ch)] = ')'
 for ch in "\"'\\\n#":
     _tran[ord(ch)] = ch
-_tran = ''.join(_tran)
-del ch
+del i, ch
 
 class Parser:
 
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to