summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-10 22:04:45 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-10 22:04:45 (GMT)
commit05e344954de5f4e55eb49dc44b0f8e1ec272a06c (patch)
tree85368f03ea1781b7669c3ebb94a5e40d57e163aa /Modules/_multiprocessing
parent4dd3a50ca480eef7bd898cfbfef8377231e18ae9 (diff)
downloadcpython-05e344954de5f4e55eb49dc44b0f8e1ec272a06c.zip
cpython-05e344954de5f4e55eb49dc44b0f8e1ec272a06c.tar.gz
cpython-05e344954de5f4e55eb49dc44b0f8e1ec272a06c.tar.bz2
#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.
Diffstat (limited to 'Modules/_multiprocessing')
-rw-r--r--Modules/_multiprocessing/connection.h6
-rw-r--r--Modules/_multiprocessing/multiprocessing.h1
2 files changed, 3 insertions, 4 deletions
diff --git a/Modules/_multiprocessing/connection.h b/Modules/_multiprocessing/connection.h
index 66a3e8a..155b61b 100644
--- a/Modules/_multiprocessing/connection.h
+++ b/Modules/_multiprocessing/connection.h
@@ -47,8 +47,8 @@ connection_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
if (handle == INVALID_HANDLE_VALUE || (Py_ssize_t)handle < 0) {
- PyErr_Format(PyExc_IOError, "invalid handle %"
- PY_FORMAT_SIZE_T "d", (Py_ssize_t)handle);
+ PyErr_Format(PyExc_IOError, "invalid handle %zd",
+ (Py_ssize_t)handle);
return NULL;
}
@@ -396,7 +396,7 @@ connection_repr(ConnectionObject *self)
static char *conn_type[] = {"read-only", "write-only", "read-write"};
assert(self->flags >= 1 && self->flags <= 3);
- return FROM_FORMAT("<%s %s, handle %" PY_FORMAT_SIZE_T "d>",
+ return FROM_FORMAT("<%s %s, handle %zd>",
conn_type[self->flags - 1],
CONNECTION_NAME, (Py_ssize_t)self->handle);
}
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index ec5042c..0b32790 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -56,7 +56,6 @@
# define PY_SSIZE_T_MAX INT_MAX
# define PY_SSIZE_T_MIN INT_MIN
# define F_PY_SSIZE_T "i"
-# define PY_FORMAT_SIZE_T ""
# define PyInt_FromSsize_t(n) PyInt_FromLong((long)n)
#else
# define F_PY_SSIZE_T "n"