Patchwork D12227: cext: remove Python 2 support

login
register
mail settings
Submitter phabricator
Date March 2, 2022, 12:24 a.m.
Message ID <differential-rev-PHID-DREV-hd3yxctvok6dvgtr7iqj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50565/
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 still alias the Python 2 symbols. This will be cleaned up in a
  separate commit.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/cext/parsers.c

CHANGE DETAILS




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

Patch

diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c
--- a/mercurial/cext/parsers.c
+++ b/mercurial/cext/parsers.c
@@ -17,7 +17,6 @@ 
 #include "charencode.h"
 #include "util.h"
 
-#ifdef IS_PY3K
 /* The mapping of Python types is meant to be temporary to get Python
  * 3 to compile. We should remove this once Python 3 support is fully
  * supported and proper types are used in the extensions themselves. */
@@ -25,13 +24,6 @@ 
 #define PyInt_FromLong PyLong_FromLong
 #define PyInt_FromSsize_t PyLong_FromSsize_t
 #define PyInt_AsLong PyLong_AsLong
-#else
-/* Windows on Python 2.7 doesn't define S_IFLNK. Python 3+ defines via
- * pyport.h. */
-#ifndef S_IFLNK
-#define S_IFLNK 0120000
-#endif
-#endif
 
 static const char *const versionerrortext = "Python minor version mismatch";