MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / compile_file

Function compile_file

uncompyle6/main.py:184–197  ·  view source on GitHub ↗
(source_path: str)

Source from the content-addressed store, hash-verified

182
183
184def compile_file(source_path: str) -> str:
185 if source_path.endswith(".py"):
186 basename = source_path[:-3]
187 else:
188 basename = source_path
189
190 if hasattr(sys, "pypy_version_info"):
191 bytecode_path = f"{basename}-pypy{version_tuple_to_str()}.pyc"
192 else:
193 bytecode_path = f"{basename}-{version_tuple_to_str()}.pyc"
194
195 print(f"compiling {source_path} to {bytecode_path}")
196 py_compile.compile(source_path, bytecode_path, "exec")
197 return bytecode_path
198
199
200def decompile_file(

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected