]> granicus.if.org Git - python/commitdiff
The change in the linecache.checkcache() signature at rev 1.13 caused IDLE to exit
authorKurt B. Kaiser <kbk@shore.net>
Sat, 13 Nov 2004 21:05:58 +0000 (21:05 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sat, 13 Nov 2004 21:05:58 +0000 (21:05 +0000)
when an exception was raised while running w/o the subprocess.  Python Bug 1063840

M NEWS.txt
M PyShell.py

Lib/idlelib/NEWS.txt
Lib/idlelib/PyShell.py

index 4df9fa555f7239da06d01f6cef87a642b196b98c..931d67e06f707ed5152acec48c5940a3048b1d18 100644 (file)
@@ -3,6 +3,9 @@ What's New in IDLE 1.1b3/rc1?
 
 *Release date: XX-XXX-2004*
 
+- A change to the linecache.py API caused IDLE to exit when an exception was
+  raised while running without the subprocess (-n switch).  Python Bug 1063840.
+
 What's New in IDLE 1.1b2?
 =========================
 
index 313c95d1bab5687e86c0c9de76055529352608fb..887d63804c4fa4e0d8f5833e182cfde50097d68b 100644 (file)
@@ -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 <pyshell#...> 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
+    <pyshell#...> 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