]> granicus.if.org Git - python/commitdiff
Fix for SF bug #448835.
authorGuido van Rossum <guido@python.org>
Tue, 7 Aug 2001 17:15:36 +0000 (17:15 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 7 Aug 2001 17:15:36 +0000 (17:15 +0000)
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.

Tools/idle/ScriptBinding.py

index b54dfc4c791931a8ec97e27c6aeae119d3a41c49..4071681b7fd16864b7bcb1ae1523c81f53981233 100644 (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))