]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clear the linecache before printing a traceback
authorGuido van Rossum <guido@python.org>
Tue, 13 Oct 1998 16:32:05 +0000 (16:32 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 13 Oct 1998 16:32:05 +0000 (16:32 +0000)
Tools/idle/PyShell.py

index cc86c2e9f6dd4249467579efbf065202548a1413..74f8f8a4048005d2a99f006733342ac7e558e3ae 100644 (file)
@@ -129,7 +129,14 @@ class ModifiedInterpreter(InteractiveInterpreter):
         # Extend base class method to reset output properly
         text = self.tkconsole.text
         self.tkconsole.resetoutput()
+        self.checklinecache()
         InteractiveInterpreter.showtraceback(self)
+        
+    def checklinecache(self):
+        c = linecache.cache
+        for key in c.keys():
+            if key[:1] + key[-1:] != "<>":
+                del c[key]
 
     def runcode(self, code):
         # Override base class method