diff options
author | Victor Stinner <vstinner@python.org> | 2020-10-27 01:24:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 01:24:34 (GMT) |
commit | c9bc290dd6e3994a4ead2a224178bcba86f0c0e4 (patch) | |
tree | f3a4e137da850af0438119da460877c3a4fd8532 /Objects/sliceobject.c | |
parent | 303aac8c56609290e122eecc14c038e9b1e4174a (diff) | |
download | cpython-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.c | 5 |
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); |