summaryrefslogtreecommitdiffstats
path: root/Objects/sliceobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-10-27 01:24:34 (GMT)
committerGitHub <noreply@github.com>2020-10-27 01:24:34 (GMT)
commitc9bc290dd6e3994a4ead2a224178bcba86f0c0e4 (patch)
treef3a4e137da850af0438119da460877c3a4fd8532 /Objects/sliceobject.c
parent303aac8c56609290e122eecc14c038e9b1e4174a (diff)
downloadcpython-c9bc290dd6e3994a4ead2a224178bcba86f0c0e4.zip
cpython-c9bc290dd6e3994a4ead2a224178bcba86f0c0e4.tar.gz
cpython-c9bc290dd6e3994a4ead2a224178bcba86f0c0e4.tar.bz2
bpo-42161: Use _PyLong_GetZero() and _PyLong_GetOne() (GH-22995)
Use _PyLong_GetZero() and _PyLong_GetOne() in Objects/ and Python/ directories.
Diffstat (limited to 'Objects/sliceobject.c')
-rw-r--r--Objects/sliceobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index e8af623..02ba033 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -15,6 +15,7 @@ this type and there is exactly one in existence.
#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
+#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_object.h" // _PyObject_GC_TRACK()
#include "structmember.h" // PyMemberDef
@@ -388,7 +389,7 @@ _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
/* Convert step to an integer; raise for zero step. */
if (self->step == Py_None) {
- step = _PyLong_One;
+ step = _PyLong_GetOne();
Py_INCREF(step);
step_is_negative = 0;
}
@@ -417,7 +418,7 @@ _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
goto error;
}
else {
- lower = _PyLong_Zero;
+ lower = _PyLong_GetZero();
Py_INCREF(lower);
upper = length;
Py_INCREF(upper);