mirror of https://github.com/python/cpython
this is better written as an assertion
This commit is contained in:
parent
fec42da1ab
commit
ac8c73075a
|
@ -1823,17 +1823,11 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
||||||
created when the exception was caught, otherwise
|
created when the exception was caught, otherwise
|
||||||
the stack will be in an inconsistent state. */
|
the stack will be in an inconsistent state. */
|
||||||
PyTryBlock *b = PyFrame_BlockPop(f);
|
PyTryBlock *b = PyFrame_BlockPop(f);
|
||||||
if (b->b_type != EXCEPT_HANDLER) {
|
assert(b->b_type == EXCEPT_HANDLER);
|
||||||
PyErr_SetString(PyExc_SystemError,
|
|
||||||
"popped block is not an except handler");
|
|
||||||
why = WHY_EXCEPTION;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
UNWIND_EXCEPT_HANDLER(b);
|
UNWIND_EXCEPT_HANDLER(b);
|
||||||
why = WHY_NOT;
|
why = WHY_NOT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (PyExceptionClass_Check(v)) {
|
else if (PyExceptionClass_Check(v)) {
|
||||||
w = POP();
|
w = POP();
|
||||||
u = POP();
|
u = POP();
|
||||||
|
|
Loading…
Reference in New Issue