[Updated] D12270: setup: remove more Python 2 support code

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Mar 2 16:27:08 UTC 2022


Closed by commit rHG3ce8001fd768: setup: remove more Python 2 support code (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D12270?vs=32361&id=32378

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D12270/new/

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

AFFECTED FILES
  setup.py

CHANGE DETAILS

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -22,23 +22,12 @@
 import sys, platform
 import sysconfig
 
-if sys.version_info[0] >= 3:
-    printf = eval('print')
-    libdir_escape = 'unicode_escape'
-
-    def sysstr(s):
-        return s.decode('latin-1')
+printf = eval('print')
+libdir_escape = 'unicode_escape'
 
-else:
-    libdir_escape = 'string_escape'
 
-    def printf(*args, **kwargs):
-        f = kwargs.get('file', sys.stdout)
-        end = kwargs.get('end', '\n')
-        f.write(b' '.join(args) + end)
-
-    def sysstr(s):
-        return s
+def sysstr(s):
+    return s.decode('latin-1')
 
 
 import ssl



To: durin42, indygreg, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220302/0979f74e/attachment-0002.html>


More information about the Mercurial-patches mailing list