cext: unconditionalize PySlice_GetIndicesEx()
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 20 Feb 2022 16:13:57 -0700
changeset 48820 acf9f778e048
parent 48819 bf6cdda979ed
child 48821 b0dd39b91e7a
cext: unconditionalize PySlice_GetIndicesEx() We only support Python 3 now. Differential Revision: https://phab.mercurial-scm.org/D12231
mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c	Sun Feb 20 16:13:23 2022 -0700
+++ b/mercurial/cext/revlog.c	Sun Feb 20 16:13:57 2022 -0700
@@ -2825,14 +2825,8 @@
 	Py_ssize_t length = index_length(self) + 1;
 	int ret = 0;
 
-/* Argument changed from PySliceObject* to PyObject* in Python 3. */
-#ifdef IS_PY3K
 	if (PySlice_GetIndicesEx(item, length, &start, &stop, &step,
 	                         &slicelength) < 0)
-#else
-	if (PySlice_GetIndicesEx((PySliceObject *)item, length, &start, &stop,
-	                         &step, &slicelength) < 0)
-#endif
 		return -1;
 
 	if (slicelength <= 0)