MCPcopy Index your code
hub / github.com/RustPython/RustPython / importer

Method importer

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

Source from the content-addressed store, hash-verified

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

Callers 1

resolveMethod · 0.80

Calls 4

release_lockMethod · 0.80
acquire_lockMethod · 0.45
setMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected