]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-16055: Fixes incorrect error text for int('1', base=1000) (#6980)
authorVictor Stinner <vstinner@redhat.com>
Fri, 18 May 2018 23:53:13 +0000 (01:53 +0200)
committerGitHub <noreply@github.com>
Fri, 18 May 2018 23:53:13 +0000 (01:53 +0200)
Fixes incorrect error text for int('1', base=1000)
and long('1', base=1000).

Objects/intobject.c
Objects/longobject.c

index 3ab00af1e28c97bca945c15336ad1a0a6d9a0bb3..9b27c35d88d06ca2e30759072b956b6f84ebe595 100644 (file)
@@ -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;
     }
 
index 5d6ce70d537dde10aaf5aa3f9f6f03643f7bcb18..f40ad7ab1b8c36b7d15335c67ed2d434ffb5f10e 100644 (file)
@@ -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)))