summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index bfacf31..f086514 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -289,8 +289,9 @@ _PySys_ClearAuditHooks(void)
/* Must be finalizing to clear hooks */
_PyRuntimeState *runtime = &_PyRuntime;
PyThreadState *ts = _PyRuntimeState_GetThreadState(runtime);
- assert(!ts || _Py_CURRENTLY_FINALIZING(runtime, ts));
- if (!ts || !_Py_CURRENTLY_FINALIZING(runtime, ts)) {
+ PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime);
+ assert(!ts || finalizing == ts);
+ if (!ts || finalizing != ts) {
return;
}