Change to overflow error

This commit is contained in:
Hunter Harloff authored and Jeong YunWon committed 2024-04-06 19:14:58 +09:00
1 parent 6a53ec3c5d
commit 9f7eb08fca
1 file changed
+3 -3
+3 -3
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 {