This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author BTaskaya
Recipients BTaskaya, terry.reedy
Date 2020-04-04.19:43:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1586029427.62.0.43223683032.issue40180@roundup.psfhosted.org>
In-reply-to
Content
What would you expect in this case? Objects/abstract.c:2429 is where the isinstance code. If only returning False would be enough, something like this (untested) would be enough

--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2436,6 +2436,10 @@ object_isinstance(PyObject *inst, PyObject *cls)
         retval = PyObject_TypeCheck(inst, (PyTypeObject *)cls);
         if (retval == 0) {
             retval = _PyObject_LookupAttrId(inst, &PyId___class__, &icls);
+            if (retval == NULL && PyErr_Occurred()) {
+                PyErr_Clear();
+                retval = 0;
+            }
History
Date User Action Args
2020-04-04 19:43:47BTaskayasetrecipients: + BTaskaya, terry.reedy
2020-04-04 19:43:47BTaskayasetmessageid: <1586029427.62.0.43223683032.issue40180@roundup.psfhosted.org>
2020-04-04 19:43:47BTaskayalinkissue40180 messages
2020-04-04 19:43:47BTaskayacreate