diff options
author | Victor Stinner <vstinner@python.org> | 2020-06-10 16:38:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-10 16:38:05 (GMT) |
commit | d36cf5f1d20ce9f111a8fc997104785086e8eee6 (patch) | |
tree | f452121f147dece783aa9a278f6ce80b012ca0bd /Modules/gcmodule.c | |
parent | 24b8bad6d30ae4fb37ee686a073adfa5308659f9 (diff) | |
download | cpython-d36cf5f1d20ce9f111a8fc997104785086e8eee6.zip cpython-d36cf5f1d20ce9f111a8fc997104785086e8eee6.tar.gz cpython-d36cf5f1d20ce9f111a8fc997104785086e8eee6.tar.bz2 |
bpo-40943: Replace PY_FORMAT_SIZE_T with "z" (GH-20781)
The PEP 353, written in 2005, introduced PY_FORMAT_SIZE_T. Python no
longer supports macOS 10.4 and Visual Studio 2010, but requires more
recent macOS and Visual Studio versions. In 2020 with Python 3.10, it
is now safe to use directly "%zu" to format size_t and "%zi" to
format Py_ssize_t.
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r-- | Modules/gcmodule.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index f68258d..b3bcc8a 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -1043,7 +1043,7 @@ show_stats_each_generations(GCState *gcstate) for (int i = 0; i < NUM_GENERATIONS && pos < sizeof(buf); i++) { pos += PyOS_snprintf(buf+pos, sizeof(buf)-pos, - " %"PY_FORMAT_SIZE_T"d", + " %zd", gc_list_size(GEN_HEAD(gcstate, i))); } @@ -1290,8 +1290,7 @@ collect(PyThreadState *tstate, int generation, if (gcstate->debug & DEBUG_STATS) { double d = _PyTime_AsSecondsDouble(_PyTime_GetMonotonicClock() - t1); PySys_WriteStderr( - "gc: done, %" PY_FORMAT_SIZE_T "d unreachable, " - "%" PY_FORMAT_SIZE_T "d uncollectable, %.4fs elapsed\n", + "gc: done, %zd unreachable, %zd uncollectable, %.4fs elapsed\n", n+m, n, d); } |