Skip to content

Commit c3d09d2

Browse files
committed
Fix incorrect condition.
1 parent 8000e9b commit c3d09d2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Python/pystate.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,7 +3158,7 @@ static int
31583158
try_acquire_strong_ref(PyInterpreterState *interp, PyInterpreterRef *strong_ptr)
31593159
{
31603160
_PyRWMutex_RLock(&interp->references.lock);
3161-
if (_PyInterpreterState_GetFinalizing(interp) == NULL) {
3161+
if (_PyInterpreterState_GetFinalizing(interp) != NULL) {
31623162
*strong_ptr = 0;
31633163
_PyRWMutex_RUnlock(&interp->references.lock);
31643164
return -1;
@@ -3356,7 +3356,6 @@ PyThreadState_Release(PyThreadRef thread_ref)
33563356
Py_FatalError("PyThreadState_Release() called more times than PyThreadState_Ensure()");
33573357
}
33583358
// The thread reference might be NULL
3359-
assert(thread_ref >= 0);
33603359
PyThreadState *to_restore = (PyThreadState *)thread_ref;
33613360
if (remaining == 0) {
33623361
if (tstate->ensure.delete_on_release) {

0 commit comments

Comments
 (0)