diff options
author | Mark Shannon <mark@hotpy.org> | 2022-10-05 00:34:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 00:34:03 (GMT) |
commit | 76449350b3467b85bcb565f9e2bf945bd150a66e (patch) | |
tree | e4237841cdb9d9984e3249823a8518c79470d73f /Lib/test/test_exceptions.py | |
parent | 0ff8fd65838f9f9ed90d7a055d26a2ce9fc0ce85 (diff) | |
download | cpython-76449350b3467b85bcb565f9e2bf945bd150a66e.zip cpython-76449350b3467b85bcb565f9e2bf945bd150a66e.tar.gz cpython-76449350b3467b85bcb565f9e2bf945bd150a66e.tar.bz2 |
GH-91079: Decouple C stack overflow checks from Python recursion checks. (GH-96510)
Diffstat (limited to 'Lib/test/test_exceptions.py')
-rw-r--r-- | Lib/test/test_exceptions.py | 8 |
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.') |