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

Method _fix_ns_for_legacy_pyc

Lib/test/test_runpy.py:285–293  ·  view source on GitHub ↗
(self, ns, alter_sys)

Source from the content-addressed store, hash-verified

283 if verbose > 1: print(ex) # Persist with cleaning up
284
285 def _fix_ns_for_legacy_pyc(self, ns, alter_sys):
286 char_to_add = "c"
287 ns["__file__"] += char_to_add
288 spec = ns["__spec__"]
289 new_spec = importlib.util.spec_from_file_location(spec.name,
290 ns["__file__"])
291 ns["__spec__"] = new_spec
292 if alter_sys:
293 ns["run_argv0"] += char_to_add
294
295
296 def _check_module(self, depth, alter_sys=False,

Callers 2

_check_moduleMethod · 0.95
_check_packageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected