Fix for SF bug #448835.

Fix this to work with the new (still undocumented) tabnanny API.

I'm afraid Stephen will have to add this fix to the IDLE fork code
base as well.
This commit is contained in:
Guido van Rossum 2001-08-07 17:15:36 +00:00
parent 15d86c6297
commit 44b1e7d840

View file

@ -69,10 +69,9 @@ class ScriptBinding:
def tabnanny(self, filename):
import tabnanny
import tokenize
tabnanny.reset_globals()
f = open(filename, 'r')
try:
tokenize.tokenize(f.readline, tabnanny.tokeneater)
tabnanny.process_tokens(tokenize.generate_tokens(f.readline))
except tokenize.TokenError, msg:
self.errorbox("Token error",
"Token error:\n%s" % str(msg))