diff --git a/Tools/idle/ScriptBinding.py b/Tools/idle/ScriptBinding.py index b54dfc4c791..4071681b7fd 100644 --- a/Tools/idle/ScriptBinding.py +++ b/Tools/idle/ScriptBinding.py @@ -69,10 +69,9 @@ def check_module_event(self, event): 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))