commit | 557287075c264d2458cd3e1b45e9b8ee5341e0a1 | [log] [tgz] |
---|---|---|
author | Andy Lester <andy@petdance.com> | Fri Mar 06 16:53:17 2020 -0600 |
committer | GitHub <noreply@github.com> | Fri Mar 06 23:53:17 2020 +0100 |
tree | 6c34331fdbf74476b60b1e32972e360af4985ab6 | |
parent | e59334ebc9308b0f3ad048ef293c6b49e6456d1a [diff] [blame] |
bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809) Co-authored-by: Victor Stinner <vstinner@python.org>
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 @@ 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);