Skip to content

Commit 290f5ae

Browse files
authored
Use Py_NewRef in Modules/_struct.c (GH-23981)
1 parent 4140f10 commit 290f5ae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Modules/_struct.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,8 +1442,7 @@ s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
14421442
self = alloc_func(type, 0);
14431443
if (self != NULL) {
14441444
PyStructObject *s = (PyStructObject*)self;
1445-
Py_INCREF(Py_None);
1446-
s->s_format = Py_None;
1445+
s->s_format = Py_NewRef(Py_None);
14471446
s->s_codes = NULL;
14481447
s->s_size = -1;
14491448
s->s_len = -1;

0 commit comments

Comments
 (0)