mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#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.
This commit is contained in:
parent
4dd3a50ca4
commit
05e344954d
5 changed files with 13 additions and 6 deletions
|
@ -670,7 +670,7 @@ deque_repr(PyObject *deque)
|
|||
return NULL;
|
||||
}
|
||||
if (((dequeobject *)deque)->maxlen != -1)
|
||||
fmt = PyString_FromFormat("deque(%%r, maxlen=%" PY_FORMAT_SIZE_T "d)",
|
||||
fmt = PyString_FromFormat("deque(%%r, maxlen=%zd)",
|
||||
((dequeobject *)deque)->maxlen);
|
||||
else
|
||||
fmt = PyString_FromString("deque(%r)");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue