summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS5
-rw-r--r--Objects/typeobject.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index cb457b2..28523fa 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,7 +13,10 @@ Core and Builtins
-----------------
- Issue #8627: Remove bogus "Overriding __cmp__ blocks inheritance of
- __hash__ in 3.x" warning.
+ __hash__ in 3.x" warning. Also fix "XXX undetected error" that
+ arises from the "Overriding __eq__ blocks inheritance ..." warning
+ when turned into an exception: in this case the exception simply
+ gets ignored.
- Issue #3798: Write sys.exit() message to sys.stderr to use stderr encoding
and error handler, instead of writing to the C stderr file in utf-8
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index af2dc0b..f496804 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -3853,10 +3853,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();
}
}
}