summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b29b5f9..28360f4 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1090,6 +1090,7 @@ eval_code2(co, globals, locals,
/* Fallthrough */
case 1:
w = POP(); /* exc */
+ case 0: /* Fallthrough */
why = do_raise(w, v, u);
break;
default:
@@ -1967,6 +1968,17 @@ static enum why_code
do_raise(type, value, tb)
PyObject *type, *value, *tb;
{
+ if (type == NULL) {
+ /* Reraise */
+ PyThreadState *tstate = PyThreadState_Get();
+ type = tstate->exc_type == NULL ? Py_None : tstate->exc_type;
+ value = tstate->exc_value;
+ tb = tstate->exc_traceback;
+ Py_XINCREF(type);
+ Py_XINCREF(value);
+ Py_XINCREF(tb);
+ }
+
/* We support the following forms of raise:
raise <class>, <classinstance>
raise <class>, <argument tuple>