[Python-checkins] r61649 - python/trunk/Objects/abstract.c

raymond.hettinger python-checkins at python.org
Wed Mar 19 23:47:49 CET 2008


Author: raymond.hettinger
Date: Wed Mar 19 23:47:48 2008
New Revision: 61649

Modified:
   python/trunk/Objects/abstract.c
Log:
Remove unnecessary traceback save/restore pair.

Modified: python/trunk/Objects/abstract.c
==============================================================================
--- python/trunk/Objects/abstract.c	(original)
+++ python/trunk/Objects/abstract.c	Wed Mar 19 23:47:48 2008
@@ -2907,22 +2907,20 @@
 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;


More information about the Python-checkins mailing list