diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-05-12 00:41:23 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-05-12 00:41:23 +0000 |
commit | b9030f4f0d566c8ae2eeb28ed858f02f3b853ae7 (patch) | |
tree | 526da2f8d50d0abaebcd5177f203adae5df7ee43 /Python/bltinmodule.c | |
parent | 42bfa90f02f0055ea163df9103ebed873ee1dbb0 (diff) | |
download | cpython-git-b9030f4f0d566c8ae2eeb28ed858f02f3b853ae7.tar.gz |
#2196 hasattr now allows SystemExit and KeyboardInterrupt to propagate
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 02a2faae3c..0234b6bd80 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -877,9 +877,13 @@ builtin_hasattr(PyObject *self, PyObject *args) } 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); |