Patchwork D12344: policy: remove Python 2.7 compatibility code

login
register
mail settings
Submitter phabricator
Date March 4, 2022, 3:33 a.m.
Message ID <differential-rev-PHID-DREV-6xcnyo5up6zcqns74xpm-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50683/
State New
Headers show

Comments

phabricator - March 4, 2022, 3:33 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/policy.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/policy.py b/mercurial/policy.py
--- a/mercurial/policy.py
+++ b/mercurial/policy.py
@@ -53,11 +53,8 @@ 
     policy = b'cffi'
 
 # Environment variable can always force settings.
-if sys.version_info[0] >= 3:
-    if 'HGMODULEPOLICY' in os.environ:
-        policy = os.environ['HGMODULEPOLICY'].encode('utf-8')
-else:
-    policy = os.environ.get('HGMODULEPOLICY', policy)
+if 'HGMODULEPOLICY' in os.environ:
+    policy = os.environ['HGMODULEPOLICY'].encode('utf-8')
 
 
 def _importfrom(pkgname, modname):