Skip to content

Commit 3fa2a37

Browse files
[3.14] gh-159293: Restore the recursion limit after the free-threading race test (GH-159311) (#159390)
Adds a cleanup to ensure interpreter state is restored after testing recursion limit changes. (cherry picked from commit aeff4cb) Co-authored-by: Noah <57315647+zolaski333@users.noreply.github.com>
1 parent a11d4cd commit 3fa2a37

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)