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

Method pop_exception

crates/vm/src/vm/mod.rs:2046–2056  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

2044 }
2045
2046 pub(crate) fn pop_exception(&self) -> Option<PyBaseExceptionRef> {
2047 let exc = self
2048 .exceptions
2049 .borrow_mut()
2050 .stack
2051 .pop()
2052 .expect("pop_exception() without nested exc stack");
2053 #[cfg(feature = "threading")]
2054 thread::update_thread_exception(self.topmost_exception());
2055 exc
2056 }
2057
2058 pub(crate) fn current_exception(&self) -> Option<PyBaseExceptionRef> {
2059 self.exceptions.borrow().stack.last().cloned().flatten()

Callers

nothing calls this directly

Calls 4

update_thread_exceptionFunction · 0.85
borrow_mutMethod · 0.80
topmost_exceptionMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected