From: Guido van Rossum Date: Tue, 13 Oct 1998 16:32:05 +0000 (+0000) Subject: Clear the linecache before printing a traceback X-Git-Tag: v1.5.2a2~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1956352b08c219f37ab639f875fcc360ff123f99;p=thirdparty%2FPython%2Fcpython.git Clear the linecache before printing a traceback --- diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index cc86c2e9f6dd..74f8f8a40480 100644 --- a/Tools/idle/PyShell.py +++ b/Tools/idle/PyShell.py @@ -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