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

Function get_all_current_exceptions

crates/vm/src/vm/thread.rs:416–422  ·  view source on GitHub ↗
(vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

414/// Acquires the global registry lock briefly, then reads each slot's exception atomically.
415#[cfg(feature = "threading")]
416pub fn get_all_current_exceptions(vm: &VirtualMachine) -> Vec<(u64, Option<PyBaseExceptionRef>)> {
417 let registry = vm.state.thread_frames.lock();
418 registry
419 .iter()
420 .map(|(id, slot)| (*id, slot.exception.to_owned()))
421 .collect()
422}
423
424/// Cleanup thread slot for the current thread. Called at thread exit.
425#[cfg(feature = "threading")]

Callers 1

_current_exceptionsFunction · 0.85

Calls 5

collectMethod · 0.80
lockMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected