summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r--Lib/test/test_exceptions.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 03a0f8b..65a3a8a 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -1372,6 +1372,7 @@ class ExceptionTests(unittest.TestCase):
code = """if 1:
import sys
from _testinternalcapi import get_recursion_depth
+ from test import support
class MyException(Exception): pass
@@ -1399,13 +1400,8 @@ class ExceptionTests(unittest.TestCase):
generator = gen()
next(generator)
recursionlimit = sys.getrecursionlimit()
- depth = get_recursion_depth()
try:
- # Upon the last recursive invocation of recurse(),
- # tstate->recursion_depth is equal to (recursion_limit - 1)
- # and is equal to recursion_limit when _gen_throw() calls
- # PyErr_NormalizeException().
- recurse(setrecursionlimit(depth + 2) - depth)
+ recurse(support.EXCEEDS_RECURSION_LIMIT)
finally:
sys.setrecursionlimit(recursionlimit)
print('Done.')