[Python-checkins] Remove the binary_subscr_dict_error label (GH-96443)
brandtbucher
webhook-mailer at python.org
Tue Aug 30 18:45:31 EDT 2022
https://github.com/python/cpython/commit/88671a9d6916229badc8b97a358a0f596f5aa0a1
commit: 88671a9d6916229badc8b97a358a0f596f5aa0a1
branch: main
author: Brandt Bucher <brandtbucher at microsoft.com>
committer: brandtbucher <brandtbucher at gmail.com>
date: 2022-08-30T15:45:24-07:00
summary:
Remove the binary_subscr_dict_error label (GH-96443)
files:
M Python/ceval.c
diff --git a/Python/ceval.c b/Python/ceval.c
index b3a0a3640eb..c61ccd7dfc6 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1621,7 +1621,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
PyObject *sub = TOP();
PyObject *res = PyDict_GetItemWithError(dict, sub);
if (res == NULL) {
- goto binary_subscr_dict_error;
+ if (!_PyErr_Occurred(tstate)) {
+ _PyErr_SetKeyError(sub);
+ }
+ goto error;
}
Py_INCREF(res);
STACK_SHRINK(1);
@@ -5193,16 +5196,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
DISPATCH_GOTO();
}
-binary_subscr_dict_error:
- {
- PyObject *sub = POP();
- if (!_PyErr_Occurred(tstate)) {
- _PyErr_SetKeyError(sub);
- }
- Py_DECREF(sub);
- goto error;
- }
-
unbound_local_error:
{
format_exc_check_arg(tstate, PyExc_UnboundLocalError,
More information about the Python-checkins
mailing list