diff options
author | Victor Stinner <vstinner@python.org> | 2021-09-29 23:28:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 23:28:10 (GMT) |
commit | 8d3e7eff0936926554db6162c992af5829dc8160 (patch) | |
tree | acf4172f123be025e35873d6052df1f61eeff0b3 /Modules | |
parent | d441437ee71ae174c008c23308b749b91020ba77 (diff) | |
download | cpython-8d3e7eff0936926554db6162c992af5829dc8160.zip cpython-8d3e7eff0936926554db6162c992af5829dc8160.tar.gz cpython-8d3e7eff0936926554db6162c992af5829dc8160.tar.bz2 |
bpo-43753: _operator.is_() uses Py_Is() (GH-28641)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_operator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_operator.c b/Modules/_operator.c index 12a5bf6..b3a8bef 100644 --- a/Modules/_operator.c +++ b/Modules/_operator.c @@ -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] |