Clear the linecache before printing a traceback
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 @@
# 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