Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit efb087b

Browse files
committed
Changed some RuntimeErrors.
1 parent 7610599 commit efb087b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Python/compile.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ parsenumber(s)
422422
x = strtol(s, &end, 0);
423423
if (*end == '\0') {
424424
if (errno != 0) {
425-
err_setstr(RuntimeError, "integer constant too large");
425+
err_setstr(OverflowError,
426+
"integer constant too large");
426427
return NULL;
427428
}
428429
return newintobject(x);
@@ -431,12 +432,12 @@ parsenumber(s)
431432
xx = strtod(s, &end);
432433
if (*end == '\0') {
433434
if (errno != 0) {
434-
err_setstr(RuntimeError, "float constant too large");
435+
err_setstr(OverflowError, "float constant too large");
435436
return NULL;
436437
}
437438
return newfloatobject(xx);
438439
}
439-
err_setstr(RuntimeError, "bad number syntax");
440+
err_setstr(SystemError, "bad number syntax?!?!");
440441
return NULL;
441442
}
442443

0 commit comments

Comments
 (0)