summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 6a6f06c..5f1ee75 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -1102,7 +1102,8 @@ Module(
e = ast.UnaryOp(op=ast.Not(), lineno=0, col_offset=0)
e.operand = e
with self.assertRaises(RecursionError):
- compile(ast.Expression(e), "<test>", "eval")
+ with support.infinite_recursion():
+ compile(ast.Expression(e), "<test>", "eval")
def test_recursion_indirect(self):
e = ast.UnaryOp(op=ast.Not(), lineno=0, col_offset=0)
@@ -1110,7 +1111,8 @@ Module(
e.operand = f
f.operand = e
with self.assertRaises(RecursionError):
- compile(ast.Expression(e), "<test>", "eval")
+ with support.infinite_recursion():
+ compile(ast.Expression(e), "<test>", "eval")
class ASTValidatorTests(unittest.TestCase):