mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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.
This commit is contained in:
parent
e37d75fce2
commit
e4b83e013b
2 changed files with 14 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue