8000 Change to overflow error · RustPython/RustPython@1bbbd3e · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bbbd3e

Browse files
committed
Change to overflow error
1 parent c98958e commit 1bbbd3e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vm/src/stdlib/itertools.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,9 +1985,9 @@ mod decl {
19851985
if n.lt(&BigInt::one()) {
19861986
return Err(vm.new_value_error("n must be at least one".to_owned()));
19871987
}
1988-
let n = n
1989-
.to_usize()
1990-
.ok_or(vm.new_value_error("Python int too large to convert to usize".to_owned()))?;
1988+
let n = n.to_usize().ok_or(
1989+
vm.new_overflow_error("Python int too large to convert to usize".to_owned()),
1990+
)?;
19911991
let iterable = iterable_ref.get_iter(vm)?;
19921992

19931993
Self {

0 commit comments

Comments
 (0)
0