MCPcopy
hub / github.com/pex-tool/pex / python_script

Method python_script

pex/finders.py:70–79  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

68 return fp.read()
69
70 def python_script(self):
71 # type: () -> Optional[ast.AST]
72 path = self._maybe_extract()
73 if not is_python_script(path, check_executable=False):
74 return None
75
76 return cast(
77 ast.AST,
78 compile(self.read_contents(path_hint=path), path, "exec", flags=0, dont_inherit=1),
79 )
80
81 def _maybe_extract(self):
82 # type: () -> str

Callers 1

execute_scriptMethod · 0.80

Calls 4

_maybe_extractMethod · 0.95
read_contentsMethod · 0.95
is_python_scriptFunction · 0.90
castFunction · 0.90

Tested by

no test coverage detected