remote iterator::stop_iter_value

This commit is contained in:
Jeong YunWon
2021-10-03 03:39:31 +09:00
parent a8a3fa653b
commit d90a8cb8f3
2 changed files with 1 additions and 6 deletions

View File

@@ -412,7 +412,7 @@ impl ExecutingFrame<'_> {
self.pop_value();
self.update_lasti(|i| *i += 1);
if err.isinstance(&vm.ctx.exceptions.stop_iteration) {
let val = iterator::stop_iter_value(vm, &err);
let val = vm.unwrap_or_none(err.get_arg(0));
self.push_value(val);
self.run(vm)
} else {

View File

@@ -25,11 +25,6 @@ where
Ok(results)
}
pub fn stop_iter_value(vm: &VirtualMachine, exc: &PyBaseExceptionRef) -> PyObjectRef {
let args = exc.args();
vm.unwrap_or_none(args.as_slice().first().cloned())
}
pub fn length_hint(vm: &VirtualMachine, iter: PyObjectRef) -> PyResult<Option<usize>> {
if let Some(len) = vm.obj_len_opt(&iter) {
match len {