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

Function _current_frames

crates/vm/src/stdlib/sys.rs:1038–1051  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1036 #[cfg(feature = "threading")]
1037 #[pyfunction]
1038 fn _current_frames(vm: &VirtualMachine) -> PyResult<PyDictRef> {
1039 use crate::AsObject;
1040 use crate::stdlib::_thread::get_all_current_frames;
1041
1042 let frames = get_all_current_frames(vm);
1043 let dict = vm.ctx.new_dict();
1044
1045 for (thread_id, frame) in frames {
1046 let key = vm.ctx.new_int(thread_id);
1047 dict.set_item(key.as_object(), frame.into(), vm)?;
1048 }
1049
1050 Ok(dict)
1051 }
1052
1053 /// Return a dictionary mapping each thread's identifier to its currently
1054 /// active exception, or None if no exception is active.

Callers

nothing calls this directly

Calls 5

get_all_current_framesFunction · 0.85
new_dictMethod · 0.80
new_intMethod · 0.45
set_itemMethod · 0.45
as_objectMethod · 0.45

Tested by

no test coverage detected