We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent adafea1 commit c98958eCopy full SHA for c98958e
1 file changed
vm/src/stdlib/itertools.rs
@@ -1985,7 +1985,9 @@ mod decl {
1985
if n.lt(&BigInt::one()) {
1986
return Err(vm.new_value_error("n must be at least one".to_owned()));
1987
}
1988
- let n = n.to_usize().unwrap();
+ let n = n
1989
+ .to_usize()
1990
+ .ok_or(vm.new_value_error("Python int too large to convert to usize".to_owned()))?;
1991
let iterable = iterable_ref.get_iter(vm)?;
1992
1993
Self {
0 commit comments