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

Function cleanup

Tools/importbench/importbench.py:110–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 importlib.machinery.SOURCE_SUFFIXES)
109 sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
110 def cleanup():
111 sys.modules.pop(name)
112 os.unlink(cache_from_source(mapping[name]))
113 for result in bench(name, cleanup, repeat=repeat, seconds=seconds):
114 assert not os.path.exists(cache_from_source(mapping[name]))
115 yield result

Callers 1

benchFunction · 0.70

Calls 3

cache_from_sourceFunction · 0.85
popMethod · 0.45
unlinkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…