From 8be6992620db18bea31c7f75a33c7dcc3782e95a Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Fri, 20 Jan 2023 21:01:30 +0300 Subject: gh-101181: Fix `unused-variable` warning in `pystate.c` (#101188) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> --- Python/pystate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Python/pystate.c b/Python/pystate.c index 464e5d6..5c1636a 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1878,11 +1878,14 @@ _PyGILState_SetTstate(PyThreadState *tstate) * interpreter is responsible to initialize it. */ return _PyStatus_OK(); } + +#ifndef NDEBUG _PyRuntimeState *runtime = tstate->interp->runtime; assert(runtime->gilstate.autoInterpreterState == tstate->interp); assert(current_tss_get(runtime) == tstate); assert(tstate->gilstate_counter == 1); +#endif return _PyStatus_OK(); } -- cgit v0.12