[Python-checkins] r73613 - python/branches/py3k/Python/ceval.c

benjamin.peterson python-checkins at python.org
Sun Jun 28 18:03:15 CEST 2009


Author: benjamin.peterson
Date: Sun Jun 28 18:03:15 2009
New Revision: 73613

Log:
this is better written as an assertion

Modified:
   python/branches/py3k/Python/ceval.c

Modified: python/branches/py3k/Python/ceval.c
==============================================================================
--- python/branches/py3k/Python/ceval.c	(original)
+++ python/branches/py3k/Python/ceval.c	Sun Jun 28 18:03:15 2009
@@ -1823,15 +1823,9 @@
 					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)) {


More information about the Python-checkins mailing list