From 2cf754d6c8a33365c66f5b33747816b2a37f0507 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 8 Dec 2022 08:55:10 +0100 Subject: [PATCH] test_ast uses infinite_recursion() to prevent crash 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. --- Lib/test/test_ast.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 773fba87632b0a..ab6a63faa59085 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")