diff options
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index c0298a8..dd05fe1 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2600,6 +2600,11 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls) static PyObject *name = NULL; PyObject *t, *v, *tb; PyObject *checker; + + /* Quick test for an exact match */ + if (Py_TYPE(inst) == (PyTypeObject *)cls) + return 1; + PyErr_Fetch(&t, &v, &tb); if (name == NULL) { |