Skip to content

Commit 97a31c7

Browse files
authored
[3.8] bpo-37990: fix gc stats (GH-15626)
(cherry picked from commit 013e52f)
1 parent bd8ca9a commit 97a31c7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix elapsed time in gc stats was not printed correctly. This bug was
2+
a regression in 3.8b4.

Modules/gcmodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,9 @@ collect(struct _gc_runtime_state *state, int generation,
11151115
}
11161116
if (state->debug & DEBUG_STATS) {
11171117
double d = _PyTime_AsSecondsDouble(_PyTime_GetMonotonicClock() - t1);
1118-
PySys_FormatStderr(
1119-
"gc: done, %zd unreachable, %zd uncollectable, %.4fs elapsed\n",
1118+
PySys_WriteStderr(
1119+
"gc: done, %" PY_FORMAT_SIZE_T "d unreachable, "
1120+
"%" PY_FORMAT_SIZE_T "d uncollectable, %.4fs elapsed\n",
11201121
n+m, n, d);
11211122
}
11221123

0 commit comments

Comments
 (0)