diff options
author | Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> | 2022-07-09 12:09:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-09 12:09:15 (GMT) |
commit | 7a341724e4dc8188f01ac338deaa414c4e6542c4 (patch) | |
tree | 96bd2e096a12cbd81994f9a772a513495b57d71f /Lib/test/test_call.py | |
parent | b4e232c4b5d977578b3c6aa86d8b76085167c313 (diff) | |
download | cpython-7a341724e4dc8188f01ac338deaa414c4e6542c4.zip cpython-7a341724e4dc8188f01ac338deaa414c4e6542c4.tar.gz cpython-7a341724e4dc8188f01ac338deaa414c4e6542c4.tar.bz2 |
[3.11] GH-93252: Fix error handling for failed Python calls (GH-94693) (GH-94708)
Automerge-Triggered-By: GH:tiran
Diffstat (limited to 'Lib/test/test_call.py')
-rw-r--r-- | Lib/test/test_call.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py index 6936f09..07355e8 100644 --- a/Lib/test/test_call.py +++ b/Lib/test/test_call.py @@ -26,6 +26,18 @@ class FunctionCalls(unittest.TestCase): self.assertIsInstance(res, dict) self.assertEqual(list(res.items()), expected) + def test_frames_are_popped_after_failed_calls(self): + # GH-93252: stuff blows up if we don't pop the new frame after + # recovering from failed calls: + def f(): + pass + for _ in range(1000): + try: + f(None) + except TypeError: + pass + # BOOM! + @cpython_only class CFunctionCallsErrorMessages(unittest.TestCase): |