diff options
author | Guido van Rossum <guido@python.org> | 1998-10-13 16:32:05 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-10-13 16:32:05 (GMT) |
commit | 1956352b08c219f37ab639f875fcc360ff123f99 (patch) | |
tree | edb6ac3f4a5e8d7416373a7894f8fcb5434b0e98 /Tools | |
parent | 49c1a7ebc2105477e6257555d6b2512e86b05a33 (diff) | |
download | cpython-1956352b08c219f37ab639f875fcc360ff123f99.zip cpython-1956352b08c219f37ab639f875fcc360ff123f99.tar.gz cpython-1956352b08c219f37ab639f875fcc360ff123f99.tar.bz2 |
Clear the linecache before printing a traceback
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/idle/PyShell.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tools/idle/PyShell.py b/Tools/idle/PyShell.py index cc86c2e..74f8f8a 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 |