diff options
author | Raymond Hettinger <python@rcn.com> | 2008-03-19 22:47:48 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-03-19 22:47:48 (GMT) |
commit | c71d2a9afd518ed264a129a55bc9c399fe173df2 (patch) | |
tree | eaf95a71ba899d3c9ebde952710cd4dfd02129cc | |
parent | 27f60a65e843d7b5d340818a91e19092df81bda8 (diff) | |
download | cpython-c71d2a9afd518ed264a129a55bc9c399fe173df2.zip cpython-c71d2a9afd518ed264a129a55bc9c399fe173df2.tar.gz cpython-c71d2a9afd518ed264a129a55bc9c399fe173df2.tar.bz2 |
Remove unnecessary traceback save/restore pair.
-rw-r--r-- | Objects/abstract.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 0ec6dee..6d948d4 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2907,22 +2907,20 @@ int PyObject_IsInstance(PyObject *inst, PyObject *cls) { static PyObject *name = NULL; - PyObject *t, *v, *tb; PyObject *checker; /* Quick test for an exact match */ if (Py_TYPE(inst) == (PyTypeObject *)cls) return 1; - PyErr_Fetch(&t, &v, &tb); - if (name == NULL) { name = PyString_InternFromString("__instancecheck__"); if (name == NULL) return -1; } checker = PyObject_GetAttr(cls, name); - PyErr_Restore(t, v, tb); + if (checker == NULL && PyErr_Occurred()) + PyErr_Clear(); if (checker != NULL) { PyObject *res; int ok = -1; |