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

Function _wo_bytecode

Tools/importbench/importbench.py:80–95  ·  view source on GitHub ↗
(module)

Source from the content-addressed store, hash-verified

78
79
80def _wo_bytecode(module):
81 name = module.__name__
82 def benchmark_wo_bytecode(seconds, repeat):
83 """Source w/o bytecode: {}"""
84 bytecode_path = cache_from_source(module.__file__)
85 if os.path.exists(bytecode_path):
86 os.unlink(bytecode_path)
87 sys.dont_write_bytecode = True
88 try:
89 yield from bench(name, lambda: sys.modules.pop(name),
90 repeat=repeat, seconds=seconds)
91 finally:
92 sys.dont_write_bytecode = False
93
94 benchmark_wo_bytecode.__doc__ = benchmark_wo_bytecode.__doc__.format(name)
95 return benchmark_wo_bytecode
96
97tabnanny_wo_bytecode = _wo_bytecode(tabnanny)
98decimal_wo_bytecode = _wo_bytecode(decimal)

Callers 1

importbench.pyFile · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…