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

Method handle_result

crates/vm/src/builtins/asyncgenerator.rs:777–785  ·  view source on GitHub ↗

Convert StopAsyncIteration to StopIteration(default_value)

(&self, result: PyResult, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

775
776 /// Convert StopAsyncIteration to StopIteration(default_value)
777 fn handle_result(&self, result: PyResult, vm: &VirtualMachine) -> PyResult {
778 match result {
779 Ok(value) => Ok(value),
780 Err(exc) if exc.fast_isinstance(vm.ctx.exceptions.stop_async_iteration) => {
781 Err(vm.new_stop_iteration(Some(self.default_value.clone())))
782 }
783 Err(exc) => Err(exc),
784 }
785 }
786}
787
788impl SelfIter for PyAnextAwaitable {}

Callers 2

sendMethod · 0.80
throwMethod · 0.80

Calls 5

fast_isinstanceMethod · 0.80
new_stop_iterationMethod · 0.80
ErrClass · 0.50
SomeClass · 0.50
cloneMethod · 0.45

Tested by

no test coverage detected