Skip to content

Commit f022e3a

Browse files
committed
fix
1 parent 32f5172 commit f022e3a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

crates/vm/src/builtins/iter.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use super::{PyInt, PyTupleRef, PyType};
66
use crate::{
7-
AsObject, Context, Py, PyObject, PyObjectRef, PyPayload, PyResult, VirtualMachine,
7+
Context, Py, PyObject, PyObjectRef, PyPayload, PyResult, VirtualMachine,
88
class::PyClassImpl,
99
function::ArgCallable,
1010
object::{Traverse, TraverseFn},
@@ -208,16 +208,7 @@ impl PySequenceIterator {
208208
};
209209
if let Some(obj) = obj {
210210
let seq = obj.sequence_unchecked();
211-
match seq.length(vm) {
212-
Ok(x) => Ok(PyInt::from(x).into_pyobject(vm)),
213-
Err(err) => {
214-
if err.fast_isinstance(vm.ctx.exceptions.recursion_error) {
215-
Err(err)
216-
} else {
217-
Ok(vm.ctx.not_implemented())
218-
}
219-
}
220-
}
211+
seq.length(vm).map(|x| PyInt::from(x).into_pyobject(vm))
221212
} else {
222213
Ok(PyInt::from(0).into_pyobject(vm))
223214
}

0 commit comments

Comments
 (0)