[Python-checkins] test_ast uses infinite_recursion() to prevent crash (#100104)
vstinner
webhook-mailer at python.org
Thu Dec 8 03:26:44 EST 2022
https://github.com/python/cpython/commit/cd67c1bb30eccd0c6fd1386405df225aed4c91a9
commit: cd67c1bb30eccd0c6fd1386405df225aed4c91a9
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2022年12月08日T09:26:38+01:00
summary:
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.
files:
M Lib/test/test_ast.py
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 773fba87632b..ab6a63faa590 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -837,7 +837,8 @@ def check_limit(prefix, repeated):
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")
More information about the Python-checkins
mailing list