summaryrefslogtreecommitdiff
path: root/Objects/odictobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-02-07 23:18:08 +0100
committerGitHub <noreply@github.com>2020-02-07 23:18:08 +0100
commit60ac6ed5579f6666130fc264d3b748ee9575e3aa (patch)
treec21d06611bea34d88dd5922850223837fa6ae733 /Objects/odictobject.c
parentde6f38db4859f7b8fe4da4556f06c52675fff24a (diff)
downloadcpython-git-60ac6ed5579f6666130fc264d3b748ee9575e3aa.tar.gz
bpo-39573: Use Py_SET_SIZE() function (GH-18402)
Replace direct acccess to PyVarObject.ob_size with usage of the Py_SET_SIZE() function.
Diffstat (limited to 'Objects/odictobject.c')
-rw-r--r--Objects/odictobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 45e089be28..f412220e8c 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -1417,8 +1417,9 @@ odict_repr(PyODictObject *self)
}
count++;
}
- if (count < PyList_GET_SIZE(pieces))
- Py_SIZE(pieces) = count;
+ if (count < PyList_GET_SIZE(pieces)) {
+ Py_SET_SIZE(pieces, count);
+ }
}
else {
PyObject *items = _PyObject_CallMethodIdNoArgs((PyObject *)self,