Convert StopAsyncIteration to StopIteration(default_value)
(&self, result: PyResult, vm: &VirtualMachine)
| 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 | |
| 788 | impl SelfIter for PyAnextAwaitable {} |
no test coverage detected