Skip to content

Commit cd67c1b

Browse files
authored
test_ast uses infinite_recursion() to prevent crash (#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.
1 parent e8fff51 commit cd67c1b

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
@@ -837,7 +837,8 @@ def check_limit(prefix, repeated):
837837
details = "Compiling ({!r} + {!r} * {})".format(
838838
prefix, repeated, depth)
839839
with self.assertRaises(RecursionError, msg=details):
840-
ast.parse(broken)
840+
with support.infinite_recursion():
841+
ast.parse(broken)
841842

842843
check_limit("a", "()")
843844
check_limit("a", ".b")

0 commit comments

Comments
 (0)