8000 Return a strong ref from _PyInterpolation_GetValue · python/cpython@23444df · GitHub
[go: up one dir, main page]

Skip to content

Commit 23444df

Browse files
committed
Return a strong ref from _PyInterpolation_GetValue
1 parent 8b24ff3 commit 23444df

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Include/internal/pycore_interpolation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern PyTypeObject _PyInterpolation_Type;
1818
PyAPI_FUNC(PyObject *) _PyInterpolation_FromStackRefStealOnSuccess(_PyStackRef *values);
1919

2020
extern PyStatus _PyInterpolation_InitTypes(PyInterpreterState *interp);
21-
extern PyObject *_PyInterpolation_GetValue(PyObject *interpolation);
21+
extern PyObject *_PyInterpolation_GetValueRef(PyObject *interpolation);
2222

2323
#ifdef __cplusplus
2424
}

Objects/interpolationobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ _PyInterpolation_FromStackRefStealOnSuccess(_PyStackRef *values)
184184
}
185185

186186
PyObject *
187-
_PyInterpolation_GetValue(PyObject *interpolation)
187+
_PyInterpolation_GetValueRef(PyObject *interpolation)
188188
{
189-
return interpolationobject_CAST(interpolation)->value;
189+
return Py_NewRef(interpolationobject_CAST(interpolation)->value);
190190
}

Objects/templateobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ template_values_get(PyObject *op, void *Py_UNUSED(data))
437437
PyObject *item;
438438
Py_ssize_t index = 0;
439439
while ((item = PyIter_Next(interpolationsiter))) {
440-
PyTuple_SET_ITEM(values, index++, Py_NewRef(_PyInterpolation_GetValue(item)));
440+
PyTuple_SET_ITEM(values, index++, _PyInterpolation_GetValueRef(item));
441441
Py_DECREF(item);
442442
}
443443

0 commit comments

Comments
 (0)
0