diff options
| author | Guido van Rossum <guido@python.org> | 1998-10-13 16:32:05 +0000 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1998-10-13 16:32:05 +0000 |
| commit | 1956352b08c219f37ab639f875fcc360ff123f99 (patch) | |
| tree | edb6ac3f4a5e8d7416373a7894f8fcb5434b0e98 /Tools/idle/PyShell.py | |
| parent | 49c1a7ebc2105477e6257555d6b2512e86b05a33 (diff) | |
| download | cpython-git-1956352b08c219f37ab639f875fcc360ff123f99.tar.gz | |
Clear the linecache before printing a traceback
Diffstat (limited to 'Tools/idle/PyShell.py')
| -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 cc86c2e9f6..74f8f8a404 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 |
