Mercurial > cpython-lru_cache-weakref
diff Lib/idlelib/PyShell.py @ 33989:4f2bbd471a21 legacy-trunk
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
| author | Kurt B. Kaiser <kbk@shore.net> |
|---|---|
| date | Sat, 13 Nov 2004 21:05:58 +0000 |
| parents | 066c7890cd61 |
| children | c9e5d1d1e887 1e8b033f91dc |
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py Sat Nov 13 17:45:39 2004 +0000 +++ b/Lib/idlelib/PyShell.py Sat Nov 13 21:05:58 2004 +0000 @@ -73,14 +73,16 @@ 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
