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

Function get_exceptions_tuple

crates/vm/src/exception_group.rs:372–383  ·  view source on GitHub ↗
(
        exc: &Py<PyBaseException>,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

370 }
371
372 fn get_exceptions_tuple(
373 exc: &Py<PyBaseException>,
374 vm: &VirtualMachine,
375 ) -> PyResult<Vec<PyObjectRef>> {
376 let obj = exc
377 .get_arg(1)
378 .ok_or_else(|| vm.new_type_error("exceptions must be a tuple"))?;
379 let tuple = obj
380 .downcast_ref::<PyTuple>()
381 .ok_or_else(|| vm.new_type_error("exceptions must be a tuple"))?;
382 Ok(tuple.to_vec())
383 }
384
385 enum ConditionMatcher {
386 Type(PyTypeRef),

Callers 2

subgroupMethod · 0.85
splitMethod · 0.85

Calls 3

ok_or_elseMethod · 0.80
to_vecMethod · 0.80
get_argMethod · 0.45

Tested by

no test coverage detected