[Python-checkins] cpython: PY_FORMAT_SIZE_T should not be used with PyErr_Format(), PyErr_Format("%zd") is

victor.stinner python-checkins at python.org
Mon Nov 18 02:05:45 CET 2013


http://hg.python.org/cpython/rev/d1dc7888656f
changeset:   87235:d1dc7888656f
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Nov 18 02:05:31 2013 +0100
summary:
  PY_FORMAT_SIZE_T should not be used with PyErr_Format(), PyErr_Format("%zd") is
portable

files:
  Python/getargs.c |  3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/Python/getargs.c b/Python/getargs.c
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -1476,8 +1476,7 @@
     nkeywords = (keywords == NULL) ? 0 : PyDict_Size(keywords);
     if (nargs + nkeywords > len) {
         PyErr_Format(PyExc_TypeError,
-                     "%s%s takes at most %d argument%s "
-                     "(%" PY_FORMAT_SIZE_T "d given)",
+                     "%s%s takes at most %d argument%s (%zd given)",
                      (fname == NULL) ? "function" : fname,
                      (fname == NULL) ? "" : "()",
                      len,

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list