Skip to content

Commit e71662c

Browse files
authored
Ensure that instruction cases are self-contained (GH-28938)
1 parent 194a952 commit e71662c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Python/ceval.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,8 +1710,8 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
17101710
DISPATCH();
17111711
}
17121712

1713-
/* We keep LOAD_CLOSURE so that the bytecode stays more readable. */
17141713
TARGET(LOAD_CLOSURE) {
1714+
/* We keep LOAD_CLOSURE so that the bytecode stays more readable. */
17151715
PyObject *value = GETLOCAL(oparg);
17161716
if (value == NULL) {
17171717
goto unbound_local_error;
@@ -3858,10 +3858,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
38583858
DISPATCH();
38593859
}
38603860

3861-
#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\
3862-
"BaseException is not allowed"
3863-
38643861
TARGET(JUMP_IF_NOT_EXC_MATCH) {
3862+
const char *cannot_catch_msg = "catching classes that do not "
3863+
"inherit from BaseException is not "
3864+
"allowed";
38653865
PyObject *right = POP();
38663866
PyObject *left = POP();
38673867
if (PyTuple_Check(right)) {
@@ -3871,7 +3871,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
38713871
PyObject *exc = PyTuple_GET_ITEM(right, i);
38723872
if (!PyExceptionClass_Check(exc)) {
38733873
_PyErr_SetString(tstate, PyExc_TypeError,
3874-
CANNOT_CATCH_MSG);
3874+
cannot_catch_msg);
38753875
Py_DECREF(left);
38763876
Py_DECREF(right);
38773877
goto error;
@@ -3881,7 +3881,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
38813881
else {
38823882
if (!PyExceptionClass_Check(right)) {
38833883
_PyErr_SetString(tstate, PyExc_TypeError,
3884-
CANNOT_CATCH_MSG);
3884+
cannot_catch_msg);
38853885
Py_DECREF(left);
38863886
Py_DECREF(right);
38873887
goto error;

0 commit comments

Comments
 (0)