diff options
author | Brandt Bucher <brandtbucher@microsoft.com> | 2022-07-09 01:52:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-09 01:52:26 (GMT) |
commit | 8a285df806816805484fed36dce5fd5b77a215a6 (patch) | |
tree | 1316ddfdbdeb547a7964106ac5f3a432bb957687 /Lib | |
parent | 4bed0db7c222f8df1b4e31107c0305214caf3f56 (diff) | |
download | cpython-8a285df806816805484fed36dce5fd5b77a215a6.zip cpython-8a285df806816805484fed36dce5fd5b77a215a6.tar.gz cpython-8a285df806816805484fed36dce5fd5b77a215a6.tar.bz2 |
GH-93252: Fix error handling for failed Python calls (GH-94693)
Diffstat (limited to 'Lib')
-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): |