Skip to content

Commit aeff4cb

Browse files
authored
gh-159293: Restore the recursion limit after the free-threading race test (#159311)
Adds a cleanup to ensure interpreter state is restored after testing recursion limit changes.
1 parent 084aff8 commit aeff4cb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎Lib/test/test_free_threading/test_races.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ def mutate():
272272
do_race(set_value, mutate)
273273

274274
def test_racing_recursion_limit(self):
275+
self.addCleanup(sys.setrecursionlimit, sys.getrecursionlimit())
276+
275277
def something_recursive():
276278
def count(n):
277279
if n > 0:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Restore the recursion limit after the free-threading recursion-limit race test
2+
to avoid failures in subsequent tests run in the same process.

0 commit comments

Comments
 (0)