Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aee2d5f

Browse files
author
Thomas Heller
committed
Better isinstance error message.
Closes SF patch # 560250. Bugfix candidate IMO.
1 parent dc8412e commit aee2d5f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Objects/abstract.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,8 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls)
19761976
/* Do not mask errors. */
19771977
if (!PyErr_Occurred())
19781978
PyErr_SetString(PyExc_TypeError,
1979-
"isinstance() arg 2 must be a class or type");
1979+
"isinstance() arg 2 must be a class, type,"
1980+
" or tuple of classes and types");
19801981
return -1;
19811982
}
19821983
Py_DECREF(cls_bases);

0 commit comments

Comments
 (0)