Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 46925:4c8375574aa9 legacy-trunk
#2196 hasattr now allows SystemExit and KeyboardInterrupt to propagate
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Mon, 12 May 2008 00:41:23 +0000 |
| parents | 7a6d7474ce6e |
| children | 7118fade575b |
line wrap: on
line diff
--- a/Python/bltinmodule.c Mon May 12 00:08:34 2008 +0000 +++ b/Python/bltinmodule.c Mon May 12 00:41:23 2008 +0000 @@ -877,9 +877,13 @@ } v = PyObject_GetAttr(v, name); if (v == NULL) { - PyErr_Clear(); - Py_INCREF(Py_False); - return Py_False; + if (!PyErr_ExceptionMatches(PyExc_Exception)) + return NULL; + else { + PyErr_Clear(); + Py_INCREF(Py_False); + return Py_False; + } } Py_DECREF(v); Py_INCREF(Py_True);
