summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/pyshell.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/pyshell.py')
-rwxr-xr-xLib/idlelib/pyshell.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index 6028700..7a27079 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -747,10 +747,11 @@ class ModifiedInterpreter(InteractiveInterpreter):
self.tkconsole.open_stack_viewer()
def checklinecache(self):
- c = linecache.cache
- for key in list(c.keys()):
+ "Remove keys other than '<pyshell#n>'."
+ cache = linecache.cache
+ for key in list(cache): # Iterate list because mutate cache.
if key[:1] + key[-1:] != "<>":
- del c[key]
+ del cache[key]
def runcommand(self, code):
"Run the code without invoking the debugger"