summaryrefslogtreecommitdiffstats
path: root/Objects/rangeobject.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-03-22 14:49:51 (GMT)
committerGitHub <noreply@github.com>2023-03-22 14:49:51 (GMT)
commit7559f5fda94ab568a1a910b17683ed81dc3426fb (patch)
treea050bbc075372c6246fe3386560596f2283ae8bb /Objects/rangeobject.c
parent713df2c53489ce8012d0ede10b70950e6b0d8372 (diff)
downloadcpython-7559f5fda94ab568a1a910b17683ed81dc3426fb.zip
cpython-7559f5fda94ab568a1a910b17683ed81dc3426fb.tar.gz
cpython-7559f5fda94ab568a1a910b17683ed81dc3426fb.tar.bz2
GH-101291: Rearrange the size bits in PyLongObject (GH-102464)
* Eliminate all remaining uses of Py_SIZE and Py_SET_SIZE on PyLongObject, adding asserts. * Change layout of size/sign bits in longobject to support future addition of immortal ints and tagged medium ints. * Add functions to hide some internals of long object, and for setting sign and digit count. * Replace uses of IS_MEDIUM_VALUE macro with _PyLong_IsCompact().
Diffstat (limited to 'Objects/rangeobject.c')
-rw-r--r--Objects/rangeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index b4d0bbf..beb86b9 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -33,7 +33,7 @@ validate_step(PyObject *step)
return PyLong_FromLong(1);
step = PyNumber_Index(step);
- if (step && _PyLong_Sign(step) == 0) {
+ if (step && _PyLong_IsZero((PyLongObject *)step)) {
PyErr_SetString(PyExc_ValueError,
"range() arg 3 must not be zero");
Py_CLEAR(step);