Kaydet (Commit) efb087b1 authored tarafından Guido van Rossum's avatar Guido van Rossum

Changed some RuntimeErrors.

üst 76105997
...@@ -422,7 +422,8 @@ parsenumber(s) ...@@ -422,7 +422,8 @@ parsenumber(s)
x = strtol(s, &end, 0); x = strtol(s, &end, 0);
if (*end == '\0') { if (*end == '\0') {
if (errno != 0) { if (errno != 0) {
err_setstr(RuntimeError, "integer constant too large"); err_setstr(OverflowError,
"integer constant too large");
return NULL; return NULL;
} }
return newintobject(x); return newintobject(x);
...@@ -431,12 +432,12 @@ parsenumber(s) ...@@ -431,12 +432,12 @@ parsenumber(s)
xx = strtod(s, &end); xx = strtod(s, &end);
if (*end == '\0') { if (*end == '\0') {
if (errno != 0) { if (errno != 0) {
err_setstr(RuntimeError, "float constant too large"); err_setstr(OverflowError, "float constant too large");
return NULL; return NULL;
} }
return newfloatobject(xx); return newfloatobject(xx);
} }
err_setstr(RuntimeError, "bad number syntax"); err_setstr(SystemError, "bad number syntax?!?!");
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment