(result: PyResult, vm: &VirtualMachine)
| 176 | } |
| 177 | |
| 178 | pub fn from_getitem_result(result: PyResult, vm: &VirtualMachine) -> PyResult<Self> { |
| 179 | match result { |
| 180 | Ok(obj) => Ok(Self::Return(obj)), |
| 181 | Err(err) if err.fast_isinstance(vm.ctx.exceptions.index_error) => { |
| 182 | Ok(Self::StopIteration(None)) |
| 183 | } |
| 184 | Err(err) if err.fast_isinstance(vm.ctx.exceptions.stop_iteration) => { |
| 185 | let args = err.get_arg(0); |
| 186 | Ok(Self::StopIteration(args)) |
| 187 | } |
| 188 | Err(err) => Err(err), |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | pub fn into_async_pyresult(self, vm: &VirtualMachine) -> PyResult { |
| 193 | match self { |
nothing calls this directly
no test coverage detected