]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Based on discussion with Martin and Thomas on python-checkins
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 20 Feb 2006 18:57:39 +0000 (18:57 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 20 Feb 2006 18:57:39 +0000 (18:57 +0000)
add a Py_SAFE_DOWNCAST() to make the code correct.

Python/getargs.c

index 530dffb61b98526598b05333a5e4b4a7823d5a28..fbf5ceff0e0ce38574dc73cb83478546a2245d43 100644 (file)
@@ -284,7 +284,7 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
                                      : len < min ? "at least" : "at most",
                                      len < min ? min : max,
                                      (len < min ? min : max) == 1 ? "" : "s",
-                                     (long)len);
+                                     Py_SAFE_DOWNCAST(len, Py_ssize_t, long));
                        message = msgbuf;
                }
                PyErr_SetString(PyExc_TypeError, message);