diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-28 16:03:15 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-28 16:03:15 (GMT) |
commit | ac8c73075af1768da0ff3ddb2a3a85ea135ca3b2 (patch) | |
tree | 8146e3e082634470d46e6b3a2bf72b84595d64e2 /Python/ceval.c | |
parent | fec42da1aba1105468593dd5e07ff3b06758848a (diff) | |
download | cpython-ac8c73075af1768da0ff3ddb2a3a85ea135ca3b2.zip cpython-ac8c73075af1768da0ff3ddb2a3a85ea135ca3b2.tar.gz cpython-ac8c73075af1768da0ff3ddb2a3a85ea135ca3b2.tar.bz2 |
this is better written as an assertion
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index a42a665..3ca972a 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)) { |