mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Change to overflow error
This commit is contained in:
1 parent
6a53ec3c5d
commit
9f7eb08fca
1 file changed
+3
-3
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user