summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-12-08 09:26:38 +0100
committerGitHub <noreply@github.com>2022-12-08 09:26:38 +0100
commitcd67c1bb30eccd0c6fd1386405df225aed4c91a9 (patch)
treebe84b8fab273b1b424d0df6fe7c1d3e0b30e24ee
parente8fff515f056737d6d055ea5438b2135863548b1 (diff)
downloadcpython-git-cd67c1bb30eccd0c6fd1386405df225aed4c91a9.tar.gz
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.
-rw-r--r--Lib/test/test_ast.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 773fba8763..ab6a63faa5 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -837,7 +837,8 @@ class AST_Tests(unittest.TestCase):
details = "Compiling ({!r} + {!r} * {})".format(
prefix, repeated, depth)
with self.assertRaises(RecursionError, msg=details):
- ast.parse(broken)
+ with support.infinite_recursion():
+ ast.parse(broken)
check_limit("a", "()")
check_limit("a", ".b")