summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2022-07-09 01:52:26 (GMT)
committerGitHub <noreply@github.com>2022-07-09 01:52:26 (GMT)
commit8a285df806816805484fed36dce5fd5b77a215a6 (patch)
tree1316ddfdbdeb547a7964106ac5f3a432bb957687 /Lib
parent4bed0db7c222f8df1b4e31107c0305214caf3f56 (diff)
downloadcpython-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.py12
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):