Change to overflow error

This commit is contained in:
Hunter Harloff
2024-04-01 19:59:55 -04:00
committed by Jeong YunWon
parent 6a53ec3c5d
commit 9f7eb08fca

View File

@@ -1985,9 +1985,9 @@ mod decl {
if n.lt(&BigInt::one()) {
return Err(vm.new_value_error("n must be at least one".to_owned()));
}
let n = n
.to_usize()
.ok_or(vm.new_value_error("Python int too large to convert to usize".to_owned()))?;
let n = n.to_usize().ok_or(
vm.new_overflow_error("Python int too large to convert to usize".to_owned()),
)?;
let iterable = iterable_ref.get_iter(vm)?;
Self {