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

Method execute_ast

pex/pex.py:816–831  ·  view source on GitHub ↗
(
        cls,
        name,  # type: str
        program,  # type: ast.AST
        argv0=None,  # type: Optional[str]
    )

Source from the content-addressed store, hash-verified

814
815 @classmethod
816 def execute_ast(
817 cls,
818 name, # type: str
819 program, # type: ast.AST
820 argv0=None, # type: Optional[str]
821 ):
822 # type: (...) -> Any
823 bootstrap.demote()
824
825 from pex.compatibility import exec_function
826
827 sys.argv[0] = argv0 or name
828 globals_map = globals().copy()
829 globals_map["__name__"] = "__main__"
830 globals_map["__file__"] = name
831 return Globals(exec_function(program, globals_map))
832
833 def execute_entry(self, entry_point):
834 # type: (Union[ModuleEntryPoint, CallableEntryPoint]) -> Any

Callers 2

execute_scriptMethod · 0.95
execute_contentMethod · 0.80

Calls 4

GlobalsClass · 0.90
exec_functionFunction · 0.90
demoteMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected