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

Method athrow

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

Source from the content-addressed store, hash-verified

177
178 #[pymethod]
179 fn athrow(
180 self,
181 exc_type: PyObjectRef,
182 exc_val: OptionalArg,
183 exc_tb: OptionalArg,
184 vm: &VirtualMachine,
185 ) -> PyResult<PyAsyncGenAThrow> {
186 warn_deprecated_throw_signature(&exc_val, &exc_tb, vm)?;
187 PyAsyncGen::init_hooks(&self, vm)?;
188 Ok(PyAsyncGenAThrow {
189 ag: self,
190 aclose: false,
191 state: AtomicCell::new(AwaitableState::Init),
192 value: (
193 exc_type,
194 exc_val.unwrap_or_none(vm),
195 exc_tb.unwrap_or_none(vm),
196 ),
197 })
198 }
199
200 #[pymethod]
201 fn aclose(self, vm: &VirtualMachine) -> PyResult<PyAsyncGenAThrow> {

Callers

nothing calls this directly

Calls 3

newFunction · 0.85
unwrap_or_noneMethod · 0.45

Tested by

no test coverage detected