MCPcopy Create free account
hub / github.com/ipython/ipython / with_patch_inspect

Function with_patch_inspect

IPython/core/ultratb.py:304–321  ·  view source on GitHub ↗

Deprecated since IPython 6.0 decorator for monkeypatching inspect.findsource

(f)

Source from the content-addressed store, hash-verified

302
303# Monkeypatch inspect to apply our bugfix.
304def with_patch_inspect(f):
305 """
306 Deprecated since IPython 6.0
307 decorator for monkeypatching inspect.findsource
308 """
309
310 def wrapped(*args, **kwargs):
311 save_findsource = inspect.findsource
312 save_getargs = inspect.getargs
313 inspect.findsource = findsource
314 inspect.getargs = getargs
315 try:
316 return f(*args, **kwargs)
317 finally:
318 inspect.findsource = save_findsource
319 inspect.getargs = save_getargs
320
321 return wrapped
322
323
324def fix_frame_records_filenames(records):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected