summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-05-19 01:53:13 +0200
committerGitHub <noreply@github.com>2018-05-19 01:53:13 +0200
commitd13169fc5ac7572a272cbcff830c3d96ba27cc7c (patch)
tree8fe53d355aa9ba0e514a46abb36ba67e5497d57e /Objects
parent6a8954a91a30954b5c4aa469ced9d14702cf2c58 (diff)
downloadcpython-git-d13169fc5ac7572a272cbcff830c3d96ba27cc7c.tar.gz
bpo-16055: Fixes incorrect error text for int('1', base=1000) (#6980)
Fixes incorrect error text for int('1', base=1000) and long('1', base=1000).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/intobject.c2
-rw-r--r--Objects/longobject.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 3ab00af1e2..9b27c35d88 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -358,7 +358,7 @@ PyInt_FromString(char *s, char **pend, int base)
if ((base != 0 && base < 2) || base > 36) {
PyErr_SetString(PyExc_ValueError,
- "int() base must be >= 2 and <= 36");
+ "int() base must be >= 2 and <= 36, or 0");
return NULL;
}
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 5d6ce70d53..f40ad7ab1b 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -1722,7 +1722,7 @@ PyLong_FromString(char *str, char **pend, int base)
if ((base != 0 && base < 2) || base > 36) {
PyErr_SetString(PyExc_ValueError,
- "long() arg 2 must be >= 2 and <= 36");
+ "long() base must be >= 2 and <= 36, or 0");
return NULL;
}
while (*str != '\0' && isspace(Py_CHARMASK(*str)))