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

Method throw

crates/vm/src/builtins/generator.rs:114–129  ·  view source on GitHub ↗
(
        &self,
        exc_type: PyObjectRef,
        exc_val: OptionalArg,
        exc_tb: OptionalArg,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

112
113 #[pymethod]
114 fn throw(
115 &self,
116 exc_type: PyObjectRef,
117 exc_val: OptionalArg,
118 exc_tb: OptionalArg,
119 vm: &VirtualMachine,
120 ) -> PyResult<PyIterReturn> {
121 warn_deprecated_throw_signature(&exc_val, &exc_tb, vm)?;
122 self.inner.throw(
123 self.as_object(),
124 exc_type,
125 exc_val.unwrap_or_none(vm),
126 exc_tb.unwrap_or_none(vm),
127 vm,
128 )
129 }
130
131 #[pymethod]
132 fn close(&self, vm: &VirtualMachine) -> PyResult<PyObjectRef> {

Callers

nothing calls this directly

Calls 3

as_objectMethod · 0.45
unwrap_or_noneMethod · 0.45

Tested by

no test coverage detected