Skip to content

Commit 2c52cdc

Browse files
committed
Fix interpreter reference count tests.
1 parent af6f6fd commit 2c52cdc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_testinternalcapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ test_interp_refcount(PyObject *self, PyObject *unused)
23622362

23632363
for (int i = 0; i < NUM_REFS; ++i) {
23642364
PyInterpreterRef_Close(refs[i]);
2365-
assert(_PyInterpreterState_Refcount(interp) == (NUM_REFS - i));
2365+
assert(_PyInterpreterState_Refcount(interp) == (NUM_REFS - i - 1));
23662366
}
23672367

23682368
Py_RETURN_NONE;
@@ -2390,7 +2390,7 @@ test_interp_weakref_incref(PyObject *self, PyObject *unused)
23902390

23912391
for (int i = 0; i < NUM_REFS; ++i) {
23922392
PyInterpreterRef_Close(refs[i]);
2393-
assert(_PyInterpreterState_Refcount(interp) == (NUM_REFS - i));
2393+
assert(_PyInterpreterState_Refcount(interp) == (NUM_REFS - i - 1));
23942394
}
23952395

23962396
PyInterpreterWeakRef_Close(wref);

0 commit comments

Comments
 (0)