Skip to content

Commit 3d7011c

Browse files
committed
gh-117008: Fix functools test_recursive_pickle()
Use support.infinite_recursion() in test_recursive_pickle() of test_functools to prevent a stack overflow on "ARM64 Windows Non-Debug" buildbot.
1 parent 3cac2af commit 3d7011c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_functools.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ def test_recursive_pickle(self):
334334
f.__setstate__((f, (), {}, {}))
335335
try:
336336
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
337-
with self.assertRaises(RecursionError):
338-
pickle.dumps(f, proto)
337+
with support.infinite_recursion():
338+
with self.assertRaises(RecursionError):
339+
pickle.dumps(f, proto)
339340
finally:
340341
f.__setstate__((capture, (), {}, {}))
341342

0 commit comments

Comments
 (0)