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

Function make_frozen

crates/vm/src/import.rs:68–76  ·  view source on GitHub ↗
(vm: &VirtualMachine, name: &str)

Source from the content-addressed store, hash-verified

66}
67
68pub fn make_frozen(vm: &VirtualMachine, name: &str) -> PyResult<PyRef<PyCode>> {
69 let frozen = vm.state.frozen.get(name).ok_or_else(|| {
70 vm.new_import_error(
71 format!("No such frozen object named {name}"),
72 vm.ctx.new_utf8_str(name),
73 )
74 })?;
75 Ok(vm.ctx.new_code(frozen.code))
76}
77
78pub fn import_frozen(vm: &VirtualMachine, module_name: &str) -> PyResult {
79 let frozen = vm.state.frozen.get(module_name).ok_or_else(|| {

Callers 1

get_frozen_objectFunction · 0.85

Calls 5

ok_or_elseMethod · 0.80
new_import_errorMethod · 0.80
new_utf8_strMethod · 0.80
getMethod · 0.45
new_codeMethod · 0.45

Tested by

no test coverage detected