MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / _get_code_from_file

Function _get_code_from_file

_pydevd_bundle/pydevd_runpy.py:273–284  ·  view source on GitHub ↗
(run_name, fname)

Source from the content-addressed store, hash-verified

271
272
273def _get_code_from_file(run_name, fname):
274 # Check for a compiled file first
275 from pkgutil import read_code
276
277 decoded_path = os.path.abspath(os.fsdecode(fname))
278 with io_open_code(decoded_path) as f:
279 code = read_code(f)
280 if code is None:
281 # That didn't work, so try it as normal source code
282 with io_open_code(decoded_path) as f:
283 code = compile(f.read(), fname, "exec")
284 return code, fname
285
286
287def run_path(path_name, init_globals=None, run_name=None):

Callers 1

run_pathFunction · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected