From: Victor Stinner Date: Thu, 8 Dec 2022 08:26:38 +0000 (+0100) Subject: test_ast uses infinite_recursion() to prevent crash (#100104) X-Git-Tag: v3.12.0a4~265 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd67c1bb30eccd0c6fd1386405df225aed4c91a9;p=thirdparty%2FPython%2Fcpython.git 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. --- 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 @@ 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")