mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Better isinstance error message.
Closes SF patch # 560250. Bugfix candidate IMO.
This commit is contained in:
parent
dc8412e541
commit
aee2d5f975
@ -1976,7 +1976,8 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls)
|
|||||||
/* Do not mask errors. */
|
/* Do not mask errors. */
|
||||||
if (!PyErr_Occurred())
|
if (!PyErr_Occurred())
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
"isinstance() arg 2 must be a class or type");
|
"isinstance() arg 2 must be a class, type,"
|
||||||
|
" or tuple of classes and types");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_DECREF(cls_bases);
|
Py_DECREF(cls_bases);
|
||||||
|
Loading…
Reference in New Issue
Block a user