bpo-43753: _operator.is_() uses Py_Is() (GH-28641)

This commit is contained in:
Victor Stinner 2021-09-30 01:28:10 +02:00 committed by GitHub
parent d441437ee7
commit 8d3e7eff09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -704,10 +704,8 @@ static PyObject *
_operator_is__impl(PyObject *module, PyObject *a, PyObject *b)
/*[clinic end generated code: output=bcd47a402e482e1d input=5fa9b97df03c427f]*/
{
PyObject *result;
result = (a == b) ? Py_True : Py_False;
Py_INCREF(result);
return result;
PyObject *result = Py_Is(a, b) ? Py_True : Py_False;
return Py_NewRef(result);
}
/*[clinic input]