Patchwork D12231: cext: unconditionalize PySlice_GetIndicesEx()

login
register
mail settings
Submitter phabricator
Date March 2, 2022, 12:24 a.m.
Message ID <differential-rev-PHID-DREV-m5gd5h2aq2hf57hmzovx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50570/
State New
Headers show

Comments

phabricator - March 2, 2022, 12:24 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We only support Python 3 now.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12231

AFFECTED FILES
  mercurial/cext/revlog.c

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -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)