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

Function exec

crates/vm/src/stdlib/builtins.rs:572–579  ·  view source on GitHub ↗
(
        source: Either<PyUtf8StrRef, PyRef<crate::builtins::PyCode>>,
        scope: ScopeArgs,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

570
571 #[pyfunction]
572 fn exec(
573 source: Either<PyUtf8StrRef, PyRef<crate::builtins::PyCode>>,
574 scope: ScopeArgs,
575 vm: &VirtualMachine,
576 ) -> PyResult {
577 let scope = scope.make_scope(vm, "exec")?;
578 run_code(vm, source, scope, crate::compiler::Mode::Exec, "exec")
579 }
580
581 fn run_code(
582 vm: &VirtualMachine,

Callers 3

create_builtinFunction · 0.70
exec_moduleMethod · 0.50
exec_moduleMethod · 0.50

Calls 2

make_scopeMethod · 0.80
run_codeFunction · 0.70

Tested by

no test coverage detected