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

Function fire_reraise

crates/vm/src/stdlib/sys/monitoring.rs:945–966  ·  view source on GitHub ↗

Only fires if no RERAISE has been fired since the last EXCEPTION_HANDLED, preventing duplicate events from chained cleanup handlers.

(
    vm: &VirtualMachine,
    code: &PyRef<PyCode>,
    offset: u32,
    exception: &PyObjectRef,
)

Source from the content-addressed store, hash-verified

943/// Only fires if no RERAISE has been fired since the last EXCEPTION_HANDLED,
944/// preventing duplicate events from chained cleanup handlers.
945pub fn fire_reraise(
946 vm: &VirtualMachine,
947 code: &PyRef<PyCode>,
948 offset: u32,
949 exception: &PyObjectRef,
950) -> PyResult<()> {
951 if RERAISE_PENDING.with(|f| f.get()) {
952 return Ok(());
953 }
954 RERAISE_PENDING.with(|f| f.set(true));
955 let result = fire(
956 vm,
957 EVENT_RERAISE,
958 code,
959 offset,
960 &[vm.ctx.new_int(offset).into(), exception.clone()],
961 );
962 if result.is_err() {
963 RERAISE_PENDING.with(|f| f.set(false));
964 }
965 result
966}
967
968pub fn fire_exception_handled(
969 vm: &VirtualMachine,

Callers 1

runMethod · 0.85

Calls 7

fireFunction · 0.85
withMethod · 0.80
is_errMethod · 0.80
getMethod · 0.45
setMethod · 0.45
new_intMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected