Skip to content

Commit 42fde2d

Browse files
test_ast uses infinite_recursion() to prevent crash (GH-100104)
test.test_ast_recursion_limit() now uses infinite_recursion() of test.support to prevent crashes on debug builds. Before this change, the test crashed on ARM64 Windows 3.x buildbot worker which builds Python in debug mode. (cherry picked from commit cd67c1b) Co-authored-by: Victor Stinner <[email protected]>
1 parent d4426c8 commit 42fde2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_ast.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,8 @@ def check_limit(prefix, repeated):
831831
details = "Compiling ({!r} + {!r} * {})".format(
832832
prefix, repeated, depth)
833833
with self.assertRaises(RecursionError, msg=details):
834-
ast.parse(broken)
834+
with support.infinite_recursion():
835+
ast.parse(broken)
835836

836837
check_limit("a", "()")
837838
check_limit("a", ".b")

0 commit comments

Comments
 (0)