comparison Python/Python-ast.c @ 49138:145449109a31 legacy-trunk

#3743: PY_FORMAT_SIZE_T is designed for the OS "printf" functions, not for PyString_FromFormat which has an independent implementation, and uses "%zd". This makes a difference on win64, where printf needs "%Id" to display 64bit values. For example, queue.__repr__ was incorrect. Reviewed by Martin von Loewis.
author Amaury Forgeot d'Arc <amauryfa@gmail.com>
date Wed, 10 Sep 2008 22:04:45 +0000
parents 52294af4b663
children 82ccc7e77ec5 dbd54bac0b6f
comparison
equal deleted inserted replaced
49131:2ab85c392a8d 49138:145449109a31
385 } 385 }
386 res = 0; /* if no error occurs, this stays 0 to the end */ 386 res = 0; /* if no error occurs, this stays 0 to the end */
387 if (PyTuple_GET_SIZE(args) > 0) { 387 if (PyTuple_GET_SIZE(args) > 0) {
388 if (numfields != PyTuple_GET_SIZE(args)) { 388 if (numfields != PyTuple_GET_SIZE(args)) {
389 PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s" 389 PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s"
390 "%" PY_FORMAT_SIZE_T "d positional argument%s", 390 "%zd positional argument%s",
391 Py_TYPE(self)->tp_name, 391 Py_TYPE(self)->tp_name,
392 numfields == 0 ? "" : "either 0 or ", 392 numfields == 0 ? "" : "either 0 or ",
393 numfields, numfields == 1 ? "" : "s"); 393 numfields, numfields == 1 ? "" : "s");
394 res = -1; 394 res = -1;
395 goto cleanup; 395 goto cleanup;