From 5c75b7a91ca7ad4133d5a7e9c245268bcfdd993e Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Mon, 20 Mar 2023 11:28:13 -0600 Subject: [PATCH] gh-102304: Fix Non-Debug Builds (gh-102846) Some debug-only code slipped in with gh-102543. https://github.com/python/cpython/issues/102304 --- Python/pystate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/pystate.c b/Python/pystate.c index 4d4213551a8..60adb54685c 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -482,8 +482,10 @@ _PyRuntimeState_Init(_PyRuntimeState *runtime) void _PyRuntimeState_Fini(_PyRuntimeState *runtime) { +#ifdef Py_REF_DEBUG /* The reftotal is cleared by _Py_FinalizeRefTotal(). */ assert(runtime->object_state.reftotal == 0); +#endif if (gilstate_tss_initialized(runtime)) { gilstate_tss_fini(runtime);