Skip to content

Commit 29b7243

Browse files
committed
Merge branch 'gh-117683-test_free_different_thread' into nogil-integration
2 parents b856049 + b775561 commit 29b7243

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)