Commit d2375bd7 authored by Barry Warsaw's avatar Barry Warsaw

PyErr_NormalizeException(): If the exception's type is a class and the

instance's class is a subclass of this, then use the instance's class
as the exception type.
parent 1154928b
......@@ -206,6 +206,14 @@ PyErr_NormalizeException(exc, val, tb)
Py_DECREF(value);
value = res;
}
/* if the class of the instance doesn't exactly match the
class of the type, believe the instance
*/
else if (inclass != type) {
Py_DECREF(type);
type = inclass;
Py_INCREF(type);
}
}
*exc = type;
*val = value;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment