MCPcopy Index your code
hub / github.com/saltstack/salt / remove_bytecode

Function remove_bytecode

tests/unit/test_loader.py:35–48  ·  view source on GitHub ↗
(module_path)

Source from the content-addressed store, hash-verified

33
34
35def remove_bytecode(module_path):
36 paths = [module_path + "c"]
37 cache_tag = sys.implementation.cache_tag
38 modname, ext = os.path.splitext(module_path.split(os.sep)[-1])
39 paths.append(
40 os.path.join(
41 os.path.dirname(module_path),
42 "__pycache__",
43 f"{modname}.{cache_tag}.pyc",
44 )
45 )
46 for path in paths:
47 if os.path.exists(path):
48 os.unlink(path)
49
50
51loader_template = """

Callers 8

update_moduleMethod · 0.85
update_moduleMethod · 0.85
rm_moduleMethod · 0.85
update_libMethod · 0.85
rm_libMethod · 0.85
update_pyfileMethod · 0.85
rm_pyfileMethod · 0.85
update_libMethod · 0.85

Calls 3

unlinkMethod · 0.80
appendMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected