Kaydet (Commit) 3a749931 authored tarafından 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.
üst 22ecb710
...@@ -206,6 +206,14 @@ PyErr_NormalizeException(exc, val, tb) ...@@ -206,6 +206,14 @@ PyErr_NormalizeException(exc, val, tb)
Py_DECREF(value); Py_DECREF(value);
value = res; 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; *exc = type;
*val = value; *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