summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-08-26 22:42:08 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-08-26 22:42:08 (GMT)
commit0668c62677e76b2acf7e4d11d5e9c1f4420a54f1 (patch)
tree0d6001ed47c5e6f715996eb2fc7e512d8c7a2de7 /Python
parent14cb6bcf2ba953735ec1ef622f8ff8e23db1f326 (diff)
downloadcpython-0668c62677e76b2acf7e4d11d5e9c1f4420a54f1.zip
cpython-0668c62677e76b2acf7e4d11d5e9c1f4420a54f1.tar.gz
cpython-0668c62677e76b2acf7e4d11d5e9c1f4420a54f1.tar.bz2
Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as to
match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__ mechanism. In the process, fix a bug where isinstance() and issubclass(), when given a tuple of classes as second argument, were looking up __instancecheck__ / __subclasscheck__ on the tuple rather than on each type object. Reviewed by Benjamin Peterson and Raymond Hettinger.
Diffstat (limited to 'Python')
-rw-r--r--Python/errors.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/Python/errors.c b/Python/errors.c
index 5d9cab5..c88a190 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -113,7 +113,6 @@ PyErr_GivenExceptionMatches(PyObject *err, PyObject *exc)
/* This function must not fail, so print the error here */
if (res == -1) {
PyErr_WriteUnraisable(err);
- /* issubclass did not succeed */
res = 0;
}
PyErr_Restore(exception, value, tb);