Skip to content

Commit 8d3e7ef

Browse files
authored
bpo-43753: _operator.is_() uses Py_Is() (GH-28641)
1 parent d441437 commit 8d3e7ef

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎Modules/_operator.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,8 @@ static PyObject *
704704
_operator_is__impl(PyObject *module, PyObject *a, PyObject *b)
705705
/*[clinic end generated code: output=bcd47a402e482e1d input=5fa9b97df03c427f]*/
706706
{
707-
PyObject *result;
708-
result = (a == b) ? Py_True : Py_False;
709-
Py_INCREF(result);
710-
return result;
707+
PyObject *result = Py_Is(a, b) ? Py_True : Py_False;
708+
return Py_NewRef(result);
711709
}
712710

713711
/*[clinic input]

0 commit comments

Comments
 (0)