MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / patch_reload

Function patch_reload

_pydev_bundle/_pydev_sys_patch.py:32–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31
32def patch_reload():
33 import builtins # Py3
34
35 if hasattr(builtins, "reload"):
36 sys.builtin_orig_reload = builtins.reload
37 builtins.reload = patched_reload(sys.builtin_orig_reload) # @UndefinedVariable
38 try:
39 import imp
40
41 sys.imp_orig_reload = imp.reload
42 imp.reload = patched_reload(sys.imp_orig_reload) # @UndefinedVariable
43 except ImportError:
44 pass # Ok, imp not available on Python 3.12.
45 else:
46 try:
47 import importlib
48
49 sys.importlib_orig_reload = importlib.reload # @UndefinedVariable
50 importlib.reload = patched_reload(sys.importlib_orig_reload) # @UndefinedVariable
51 except:
52 pass
53
54 del builtins
55
56
57def cancel_patches_in_sys_module():

Callers 1

Calls 1

patched_reloadFunction · 0.85

Tested by

no test coverage detected