mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Clear the linecache before printing a traceback
This commit is contained in:
parent
49c1a7ebc2
commit
1956352b08
1 changed files with 7 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue