From f7a8899f33fb0a1efe6cb57fc1b712fa1059d0a6 Mon Sep 17 00:00:00 2001 From: "Kurt B. Kaiser" Date: Sat, 13 Nov 2004 21:05:58 +0000 Subject: The change in the linecache.checkcache() signature at rev 1.13 caused IDLE to exit when an exception was raised while running w/o the subprocess. Python Bug 1063840 M NEWS.txt M PyShell.py --- Lib/idlelib/PyShell.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Lib/idlelib/PyShell.py') diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 313c95d1ba..887d63804c 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -73,14 +73,16 @@ else: return s warnings.formatwarning = idle_formatwarning -def extended_linecache_checkcache(orig_checkcache=linecache.checkcache): +def extended_linecache_checkcache(filename=None, + orig_checkcache=linecache.checkcache): """Extend linecache.checkcache to preserve the entries - Rather than repeating the linecache code, patch it to save the pyshell# - entries, call the original linecache.checkcache(), and then restore the - saved entries. Assigning the orig_checkcache keyword arg freezes its value - at definition time to the (original) method linecache.checkcache(), i.e. - makes orig_checkcache lexical. + Rather than repeating the linecache code, patch it to save the + entries, call the original linecache.checkcache() + (which destroys them), and then restore the saved entries. + + orig_checkcache is bound at definition time to the original + method, allowing it to be patched. """ cache = linecache.cache -- cgit v1.2.1