summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-06-05 12:14:43 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-06-05 12:14:43 (GMT)
commite4b83e013ba8c2bda78163da38783f79b1a86079 (patch)
tree417f427bc5b3af9846782d891eeb52767f32f8ae /Objects
parente37d75fce22f6c216148102652db64744ac06a6e (diff)
downloadcpython-e4b83e013ba8c2bda78163da38783f79b1a86079.zip
cpython-e4b83e013ba8c2bda78163da38783f79b1a86079.tar.gz
cpython-e4b83e013ba8c2bda78163da38783f79b1a86079.tar.bz2
Issue #8627: Fix "XXX undetected error" from unchecked PyErr_WarnPy3k return.
This is just a quick fix: if the warning is turned into an exception, the exception simply gets ignored.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 5767b87..b28ab4d 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3869,10 +3869,16 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
(base->tp_hash != PyObject_HashNotImplemented) &&
!OVERRIDES_HASH(type)) {
if (OVERRIDES_EQ(type)) {
- PyErr_WarnPy3k("Overriding "
- "__eq__ blocks inheritance "
- "of __hash__ in 3.x",
- 1);
+ if (PyErr_WarnPy3k("Overriding "
+ "__eq__ blocks inheritance "
+ "of __hash__ in 3.x",
+ 1) < 0)
+ /* XXX This isn't right. If the warning is turned
+ into an exception, we should be communicating
+ the error back to the caller, but figuring out
+ how to clean-up in that case is tricky. See
+ issue 8627 for more. */
+ PyErr_Clear();
}
}
}