MCPcopy Create free account
hub / github.com/celery/celery / debug_import

Function debug_import

celery/__init__.py:62–67  ·  view source on GitHub ↗
(name, locals=None, globals=None,
                     fromlist=None, level=-1, real_import=builtins.__import__)

Source from the content-addressed store, hash-verified

60 import builtins
61
62 def debug_import(name, locals=None, globals=None,
63 fromlist=None, level=-1, real_import=builtins.__import__):
64 glob = globals or getattr(sys, 'emarfteg_'[::-1])(1).f_globals
65 importer_name = glob and glob.get('__name__') or 'unknown'
66 print(f'-- {importer_name} imports {name}')
67 return real_import(name, locals, globals, fromlist, level)
68 builtins.__import__ = debug_import
69
70if TYPE_CHECKING:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected