From: Benjamin Peterson Date: Sun, 28 Jun 2009 16:03:15 +0000 (+0000) Subject: this is better written as an assertion X-Git-Tag: v3.2a1~2976 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac8c73075af1768da0ff3ddb2a3a85ea135ca3b2;p=python this is better written as an assertion --- diff --git a/Python/ceval.c b/Python/ceval.c index a42a66559b..3ca972a697 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1823,15 +1823,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) created when the exception was caught, otherwise the stack will be in an inconsistent state. */ PyTryBlock *b = PyFrame_BlockPop(f); - if (b->b_type != EXCEPT_HANDLER) { - PyErr_SetString(PyExc_SystemError, - "popped block is not an except handler"); - why = WHY_EXCEPTION; - } - else { - UNWIND_EXCEPT_HANDLER(b); - why = WHY_NOT; - } + assert(b->b_type == EXCEPT_HANDLER); + UNWIND_EXCEPT_HANDLER(b); + why = WHY_NOT; } } else if (PyExceptionClass_Check(v)) {