Batuhan Taskaya <[email protected]> added the comment:
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;
+ }
----------
nosy: +BTaskaya
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40180>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com