Skip to content

Commit 6b48afe

Browse files
committed
Fix test_compile
1 parent 0f95afc commit 6b48afe

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Lib/test/test_compile.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -714,19 +714,17 @@ def test_yet_more_evil_still_undecodable(self):
714714
def test_compiler_recursion_limit(self):
715715
# Compiler frames are small
716716
limit = 100
717-
fail_depth = limit * 1500
718717
crash_depth = limit * 5000
719718
success_depth = limit
720719

721720
def check_limit(prefix, repeated, mode="single"):
722721
expect_ok = prefix + repeated * success_depth
723722
compile(expect_ok, '<test>', mode)
724-
for depth in (fail_depth, crash_depth):
725-
broken = prefix + repeated * depth
726-
details = "Compiling ({!r} + {!r} * {})".format(
727-
prefix, repeated, depth)
728-
with self.assertRaises(RecursionError, msg=details):
729-
compile(broken, '<test>', mode)
723+
broken = prefix + repeated * crash_depth
724+
details = "Compiling ({!r} + {!r} * {})".format(
725+
prefix, repeated, crash_depth)
726+
with self.assertRaises(RecursionError, msg=details):
727+
compile(broken, '<test>', mode)
730728

731729
check_limit("a", "()")
732730
check_limit("a", ".b")

0 commit comments

Comments
 (0)