diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-05-16 22:30:48 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-05-16 22:30:48 (GMT) |
commit | 94eaba78b738309180381b9cb44efceca48c53ff (patch) | |
tree | 18d54917bc8ca72ab143ecb71ef81a17431bcc6f /Objects | |
parent | fb6fb062e8f677dd63943f3a4b8a45c6665b3418 (diff) | |
download | cpython-94eaba78b738309180381b9cb44efceca48c53ff.zip cpython-94eaba78b738309180381b9cb44efceca48c53ff.tar.gz cpython-94eaba78b738309180381b9cb44efceca48c53ff.tar.bz2 |
deal with old-style classes in issubclass and isinstance
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 5fb7bfc..2266fa1 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2927,7 +2927,7 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls) return r; } - if (PyInstance_Check(cls)) { + if (PyClass_Check(cls) || PyInstance_Check(cls)) { checker = PyObject_GetAttrString(cls, "__instancecheck__"); if (checker == NULL) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) @@ -3013,7 +3013,7 @@ PyObject_IsSubclass(PyObject *derived, PyObject *cls) Py_LeaveRecursiveCall(); return r; } - if (PyInstance_Check(cls)) { + if (PyClass_Check(cls) || PyInstance_Check(cls)) { PyErr_Fetch(&t, &v, &tb); checker = PyObject_GetAttr(cls, name); if (checker == NULL && |