mirror of
https://github.com/python/cpython.git
synced 2025-10-03 05:35:59 +00:00
more specific exception for wrong kind of raise #8082
This commit is contained in:
parent
5da7e7ce3f
commit
9c4742e6ce
1 changed files with 3 additions and 2 deletions
|
@ -3539,7 +3539,8 @@ do_raise(PyObject *type, PyObject *value, PyObject *tb)
|
||||||
/* Not something you can raise. You get an exception
|
/* Not something you can raise. You get an exception
|
||||||
anyway, just not what you specified :-) */
|
anyway, just not what you specified :-) */
|
||||||
PyErr_Format(PyExc_TypeError,
|
PyErr_Format(PyExc_TypeError,
|
||||||
"exceptions must be classes or instances, not %s",
|
"exceptions must be old-style classes or "
|
||||||
|
"derived from BaseException, not %s",
|
||||||
type->ob_type->tp_name);
|
type->ob_type->tp_name);
|
||||||
goto raise_error;
|
goto raise_error;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue