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

Function make_legacy_pyc

Lib/test/support/import_helper.py:55–66  ·  view source on GitHub ↗

Move a PEP 3147/488 pyc file to its legacy pyc location. :param source: The file system path to the source file. The source file does not need to exist, however the PEP 3147/488 pyc file must exist. :return: The file system path to the legacy pyc file.

(source)

Source from the content-addressed store, hash-verified

53
54
55def make_legacy_pyc(source):
56 """Move a PEP 3147/488 pyc file to its legacy pyc location.
57
58 :param source: The file system path to the source file. The source file
59 does not need to exist, however the PEP 3147/488 pyc file must exist.
60 :return: The file system path to the legacy pyc file.
61 """
62 pyc_file = importlib.util.cache_from_source(source)
63 assert source.endswith('.py')
64 legacy_pyc = source + 'c'
65 shutil.move(pyc_file, legacy_pyc)
66 return legacy_pyc
67
68
69def import_module(name, deprecated=False, *, required_on=()):

Callers 12

_check_moduleMethod · 0.90
_check_packageMethod · 0.90
manipulate_bytecodeMethod · 0.90
run_testMethod · 0.90
test_file_to_sourceMethod · 0.90
make_zip_scriptFunction · 0.90

Calls 2

endswithMethod · 0.45
moveMethod · 0.45

Tested by 11

_check_moduleMethod · 0.72
_check_packageMethod · 0.72
manipulate_bytecodeMethod · 0.72
run_testMethod · 0.72
test_file_to_sourceMethod · 0.72