Index: Python/ceval.c =================================================================== --- Python/ceval.c (revision 68762) +++ Python/ceval.c (working copy) @@ -1705,7 +1705,7 @@ 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) { + if (unlikely(b->b_type != EXCEPT_HANDLER)) { PyErr_SetString(PyExc_SystemError, "popped block is not an except handler"); why = WHY_EXCEPTION; @@ -1716,14 +1716,14 @@ } } } - else if (PyExceptionClass_Check(v)) { + else if likely(PyExceptionClass_Check(v)) { w = POP(); u = POP(); PyErr_Restore(v, w, u); why = WHY_RERAISE; break; } - else if (v != Py_None) { + else if (unlikely(v != Py_None)) { PyErr_SetString(PyExc_SystemError, "'finally' pops bad exception"); why = WHY_EXCEPTION;