summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-06-08 13:31:07 +0000
committerGeorg Brandl <georg@python.org>2006-06-08 13:31:07 +0000
commit9a29fe4c9602dbc3a09356a3032fa3855b1aa7ef (patch)
tree48c2bdfec99bafd0ab29dd94f65ed1ce733e6f5f /Python
parentaeb2504cf687a3681d0fc1aa66ea8c5ddc1b8845 (diff)
downloadcpython-9a29fe4c9602dbc3a09356a3032fa3855b1aa7ef.tar.gz
Argh. "integer" is a very confusing word ;)
Actually, checking for INT_MAX and INT_MIN is correct since the format code explicitly handles a C "int".
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 727376d640..1552790ef0 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -624,12 +624,12 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
ival = PyInt_AsLong(arg);
if (ival == -1 && PyErr_Occurred())
return converterr("integer<i>", arg, msgbuf, bufsize);
- else if (ival > LONG_MAX) {
+ else if (ival > INT_MAX) {
PyErr_SetString(PyExc_OverflowError,
"signed integer is greater than maximum");
return converterr("integer<i>", arg, msgbuf, bufsize);
}
- else if (ival < LONG_MIN) {
+ else if (ival < INT_MIN) {
PyErr_SetString(PyExc_OverflowError,
"signed integer is less than minimum");
return converterr("integer<i>", arg, msgbuf, bufsize);