mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
remote iterator::stop_iter_value
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user