diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-28 16:03:15 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-28 16:03:15 +0000 |
commit | 3d33d96fe953038fa99e571aebd6e9fca27b74b0 (patch) | |
tree | 1ce512d546b3604c343de0348a094a90a7ae9324 /Python/ceval.c | |
parent | 087c4b37e2d8c2e108c700564e1f13e8b87952fa (diff) | |
download | cpython-3d33d96fe953038fa99e571aebd6e9fca27b74b0.tar.gz |
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 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)) { |