From: Nikita Sobolev Date: Fri, 20 Jan 2023 18:01:30 +0000 (+0300) Subject: gh-101181: Fix `unused-variable` warning in `pystate.c` (#101188) X-Git-Tag: v3.12.0a5~148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8be6992620db18bea31c7f75a33c7dcc3782e95a;p=thirdparty%2FPython%2Fcpython.git gh-101181: Fix `unused-variable` warning in `pystate.c` (#101188) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> --- diff --git a/Python/pystate.c b/Python/pystate.c index 464e5d63e4c4..5c1636a8dc37 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(); }