summaryrefslogtreecommitdiffstats
path: root/Objects/complexobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-07-31 06:09:36 (GMT)
committerGitHub <noreply@github.com>2018-07-31 06:09:36 (GMT)
commit48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202 (patch)
tree6678ae7f56e368ef192b8e0f5988f7c317dbb246 /Objects/complexobject.c
parentdc9039da239ee572eaaf56e4a026be1fc4d74e24 (diff)
downloadcpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.zip
cpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.tar.gz
cpython-48c8bf21f97aeb124dbd48bf2bdec1ab4ebc5202.tar.bz2
[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r--Objects/complexobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index aaefa2d..871eea3 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -796,7 +796,7 @@ complex_richcompare(PyObject *v, PyObject *w, int op)
* NotImplemented. Only comparisons with core numeric types raise
* TypeError.
*/
- if (PyInt_Check(w) || PyLong_Check(w) ||
+ if (_PyAnyInt_Check(w) ||
PyFloat_Check(w) || PyComplex_Check(w)) {
PyErr_SetString(PyExc_TypeError,
"no ordering relation is defined "
@@ -809,7 +809,7 @@ complex_richcompare(PyObject *v, PyObject *w, int op)
assert(PyComplex_Check(v));
TO_COMPLEX(v, i);
- if (PyInt_Check(w) || PyLong_Check(w)) {
+ if (_PyAnyInt_Check(w)) {
/* Check for 0.0 imaginary part first to avoid the rich
* comparison when possible.
*/