summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-06 22:53:17 (GMT)
committerGitHub <noreply@github.com>2020-03-06 22:53:17 (GMT)
commit557287075c264d2458cd3e1b45e9b8ee5341e0a1 (patch)
tree6c34331fdbf74476b60b1e32972e360af4985ab6 /Objects/tupleobject.c
parente59334ebc9308b0f3ad048ef293c6b49e6456d1a (diff)
downloadcpython-557287075c264d2458cd3e1b45e9b8ee5341e0a1.zip
cpython-557287075c264d2458cd3e1b45e9b8ee5341e0a1.tar.gz
cpython-557287075c264d2458cd3e1b45e9b8ee5341e0a1.tar.bz2
bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 92374cc..52ecb54 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -881,7 +881,7 @@ _PyTuple_Resize(PyObject **pv, Py_ssize_t newsize)
Py_ssize_t oldsize;
v = (PyTupleObject *) *pv;
- if (v == NULL || Py_TYPE(v) != &PyTuple_Type ||
+ if (v == NULL || !Py_IS_TYPE(v, &PyTuple_Type) ||
(Py_SIZE(v) != 0 && Py_REFCNT(v) != 1)) {
*pv = 0;
Py_XDECREF(v);