Skip to content

Commit b775561

Browse files
committed
LAST_FREED may have a non-None value from previous tests
1 parent 63f23d5 commit b775561

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Lib/test/test_code.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -865,11 +865,10 @@ def __init__(self, f, test):
865865
def run(self):
866866
del self.f
867867
gc_collect()
868-
if Py_GIL_DISABLED:
869-
# gh-117683: The code object's destructor may still
870-
# be running concurrently in the main thread.
871-
self.test.assertIn(LAST_FREED, (None, 500))
872-
else:
868+
# gh-117683: In the free-threaded build, the code object's
869+
# destructor may still be running concurrently in the main
870+
# thread.
871+
if not Py_GIL_DISABLED:
873872
self.test.assertEqual(LAST_FREED, 500)
874873

875874
SetExtra(f.__code__, FREE_INDEX, ctypes.c_voidp(500))

0 commit comments

Comments
 (0)