MCPcopy Index your code
hub / github.com/python/cpython / importer

Method importer

Lib/test/test_fork1.py:30–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 partial_module = "partial"
29 complete_module = "complete"
30 def importer():
31 imp.acquire_lock()
32 sys.modules[fake_module_name] = partial_module
33 import_started.set()
34 time.sleep(0.01) # Give the other thread time to try and acquire.
35 sys.modules[fake_module_name] = complete_module
36 imp.release_lock()
37 t = threading.Thread(target=importer)
38 t.start()
39 import_started.wait()

Callers 1

resolveMethod · 0.80

Calls 3

acquire_lockMethod · 0.45
setMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected