]> granicus.if.org Git - python/commitdiff
this is better written as an assertion
authorBenjamin Peterson <benjamin@python.org>
Sun, 28 Jun 2009 16:03:15 +0000 (16:03 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 28 Jun 2009 16:03:15 +0000 (16:03 +0000)
Python/ceval.c

index a42a66559b8a945c605089b379e592acc4fd48db..3ca972a697acdd7d8b2a02c9fae26627a066561c 100644 (file)
@@ -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)) {