mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
Use PyErr_WarnPy3k throughout
This commit is contained in:
parent
a692c4df63
commit
9f4f48114f
14 changed files with 47 additions and 88 deletions
|
|
@ -1778,10 +1778,8 @@ dict_richcompare(PyObject *v, PyObject *w, int op)
|
|||
}
|
||||
else {
|
||||
/* Py3K warning if comparison isn't == or != */
|
||||
if (Py_Py3kWarningFlag &&
|
||||
PyErr_Warn(PyExc_DeprecationWarning,
|
||||
"dict inequality comparisons not supported "
|
||||
"in 3.x") < 0) {
|
||||
if (PyErr_WarnPy3k("dict inequality comparisons not supported "
|
||||
"in 3.x", 1) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
res = Py_NotImplemented;
|
||||
|
|
@ -1811,10 +1809,8 @@ dict_contains(register PyDictObject *mp, PyObject *key)
|
|||
static PyObject *
|
||||
dict_has_key(register PyDictObject *mp, PyObject *key)
|
||||
{
|
||||
if (Py_Py3kWarningFlag &&
|
||||
PyErr_Warn(PyExc_DeprecationWarning,
|
||||
"dict.has_key() not supported in 3.x; "
|
||||
"use the in operator") < 0)
|
||||
if (PyErr_WarnPy3k("dict.has_key() not supported in 3.x; "
|
||||
"use the in operator", 1) < 0)
|
||||
return NULL;
|
||||
return dict_contains(mp, key);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue