Clear the linecache before printing a traceback
This commit is contained in:
parent
49c1a7ebc2
commit
1956352b08
|
@ -129,7 +129,14 @@ class ModifiedInterpreter(InteractiveInterpreter):
|
||||||
# Extend base class method to reset output properly
|
# Extend base class method to reset output properly
|
||||||
text = self.tkconsole.text
|
text = self.tkconsole.text
|
||||||
self.tkconsole.resetoutput()
|
self.tkconsole.resetoutput()
|
||||||
|
self.checklinecache()
|
||||||
InteractiveInterpreter.showtraceback(self)
|
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):
|
def runcode(self, code):
|
||||||
# Override base class method
|
# Override base class method
|
||||||
|
|
Loading…
Reference in New Issue