Skip to content

Commit 569002d

Browse files
committed
Avoid reference counts on pyslice_fromindices
1 parent 6ef2578 commit 569002d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Objects/sliceobject.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ _PySlice_FromIndices(Py_ssize_t istart, Py_ssize_t istop)
177177
return NULL;
178178
}
179179

180-
slice = PySlice_New(start, end, NULL);
181-
Py_DECREF(start);
182-
Py_DECREF(end);
180+
slice = _PyBuildSlice_ConsumeRefs(start, end);
183181
return slice;
184182
}
185183

0 commit comments

Comments
 (0)