diff options
| author | Victor Stinner <vstinner@python.org> | 2022-11-16 18:34:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-16 18:34:24 +0100 |
| commit | 8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b (patch) | |
| tree | 510409237622aa30dfc6833602bdde97c578f2bb /Objects/namespaceobject.c | |
| parent | 19c1462e8dca3319c8290e2edcce482bd18cb018 (diff) | |
| download | cpython-git-8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b.tar.gz | |
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef()
and Py_XNewRef().
Diffstat (limited to 'Objects/namespaceobject.c')
| -rw-r--r-- | Objects/namespaceobject.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 7875e7cafe..2cc4ddd3c9 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -85,9 +85,8 @@ namespace_repr(PyObject *ns) if (pairs == NULL) goto error; - d = ((_PyNamespaceObject *)ns)->ns_dict; - assert(d != NULL); - Py_INCREF(d); + assert(((_PyNamespaceObject *)ns)->ns_dict != NULL); + d = Py_NewRef(((_PyNamespaceObject *)ns)->ns_dict); keys = PyDict_Keys(d); if (keys == NULL) |
