summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-11-16 17:34:24 (GMT)
committerGitHub <noreply@github.com>2022-11-16 17:34:24 (GMT)
commit8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b (patch)
tree510409237622aa30dfc6833602bdde97c578f2bb /Python/bltinmodule.c
parent19c1462e8dca3319c8290e2edcce482bd18cb018 (diff)
downloadcpython-8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b.zip
cpython-8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b.tar.gz
cpython-8211cf5d287acfd815b6a7f6471cdf83dcd2bb9b.tar.bz2
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 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index b23f52e..119e21a 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2402,8 +2402,7 @@ builtin_vars(PyObject *self, PyObject *args)
if (!PyArg_UnpackTuple(args, "vars", 0, 1, &v))
return NULL;
if (v == NULL) {
- d = PyEval_GetLocals();
- Py_XINCREF(d);
+ d = Py_XNewRef(PyEval_GetLocals());
}
else {
if (_PyObject_LookupAttr(v, &_Py_ID(__dict__), &d) == 0) {