MCPcopy Index your code
hub / github.com/RustPython/RustPython / run_simple_file

Method run_simple_file

crates/vm/src/vm/python_run.rs:81–85  ·  view source on GitHub ↗

_PyRun_SimpleFileObject Execute a Python file with __main__ module setup. Sets __file__ and __cached__ before execution, removes them after.

(&self, scope: Scope, path: &str)

Source from the content-addressed store, hash-verified

79 /// Execute a Python file with __main__ module setup.
80 /// Sets __file__ and __cached__ before execution, removes them after.
81 fn run_simple_file(&self, scope: Scope, path: &str) -> PyResult<()> {
82 self.with_simple_run(path, |module_dict| {
83 self.run_simple_file_inner(module_dict, scope, path)
84 })
85 }
86
87 fn run_simple_file_inner(
88 &self,

Callers 1

run_any_fileMethod · 0.80

Calls 2

with_simple_runMethod · 0.80
run_simple_file_innerMethod · 0.80

Tested by

no test coverage detected