]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101181: Fix `unused-variable` warning in `pystate.c` (#101188)
authorNikita Sobolev <mail@sobolevn.me>
Fri, 20 Jan 2023 18:01:30 +0000 (21:01 +0300)
committerGitHub <noreply@github.com>
Fri, 20 Jan 2023 18:01:30 +0000 (23:31 +0530)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Python/pystate.c

index 464e5d63e4c409b81fc06b9d63940b8ff2992170..5c1636a8dc37f0999e278954e236b21458203ab8 100644 (file)
@@ -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();
 }