mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-39573: Use Py_IS_TYPE() macro to check for types (GH-18809)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
e59334ebc9
commit
557287075c
10 changed files with 15 additions and 17 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue