Skip to content

Commit 5fb191b

Browse files
committed
Use a standard validator
1 parent f67bca9 commit 5fb191b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/parsenum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ mp_obj_t mp_parse_num_integer(const char *restrict str_, size_t len, int base, m
5555
mp_obj_t ret_val;
5656

5757
// check radix base
58-
if ((base != 0 && base < 2) || base > 36) {
58+
if (base != 0) {
5959
// this won't be reached if lex!=NULL
60-
mp_raise_ValueError(MP_ERROR_TEXT("int() arg 2 must be >= 2 and <= 36"));
60+
mp_arg_validate_int_range(base, 2, 36, MP_QSTR_base);
6161
}
6262

6363
// skip leading space

0 commit comments

Comments
 (0)