mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
merge 3.2 (#11627)
This commit is contained in:
commit
e92cd0ce98
3 changed files with 19 additions and 0 deletions
|
@ -3494,6 +3494,13 @@ do_raise(PyObject *exc, PyObject *cause)
|
|||
value = PyObject_CallObject(exc, NULL);
|
||||
if (value == NULL)
|
||||
goto raise_error;
|
||||
if (!PyExceptionInstance_Check(value)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"calling %R should have returned an instance of "
|
||||
"BaseException, not %R",
|
||||
type, Py_TYPE(value));
|
||||
goto raise_error;
|
||||
}
|
||||
}
|
||||
else if (PyExceptionInstance_Check(exc)) {
|
||||
value = exc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue