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

Method unwrap_pyresult

crates/vm/src/vm/vm_object.rs:83–90  ·  view source on GitHub ↗
(&self, result: PyResult<T>)

Source from the content-addressed store, hash-verified

81
82 #[track_caller]
83 pub fn unwrap_pyresult<T>(&self, result: PyResult<T>) -> T {
84 match result {
85 Ok(x) => x,
86 Err(exc) => {
87 self._py_panic_failed(exc, "called `vm.unwrap_pyresult()` on an `Err` value")
88 }
89 }
90 }
91 #[track_caller]
92 pub fn expect_pyresult<T>(&self, result: PyResult<T>, msg: &str) -> T {
93 match result {

Callers 3

bench_rustpython_codeFunction · 0.80
bench_rustpython_codeFunction · 0.80
test_run_scriptFunction · 0.80

Calls 1

_py_panic_failedMethod · 0.80

Tested by 1

test_run_scriptFunction · 0.64