Message365776
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;
+ } |
|
Date |
User |
Action |
Args |
2020-04-04 19:43:47 | BTaskaya | set | recipients:
+ BTaskaya, terry.reedy |
2020-04-04 19:43:47 | BTaskaya | set | messageid: <1586029427.62.0.43223683032.issue40180@roundup.psfhosted.org> |
2020-04-04 19:43:47 | BTaskaya | link | issue40180 messages |
2020-04-04 19:43:47 | BTaskaya | create | |
|