From: Victor Stinner Date: Fri, 18 May 2018 23:53:13 +0000 (+0200) Subject: bpo-16055: Fixes incorrect error text for int('1', base=1000) (#6980) X-Git-Tag: v2.7.16rc1~300 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d13169fc5ac7572a272cbcff830c3d96ba27cc7c;p=thirdparty%2FPython%2Fcpython.git 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). --- diff --git a/Objects/intobject.c b/Objects/intobject.c index 3ab00af1e28c..9b27c35d88d0 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 5d6ce70d537d..f40ad7ab1b8c 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)))