changeset 48917:3ce8001fd768

setup: remove more Python 2 support code I'll inline print() etc in future patches. Differential Revision: https://phab.mercurial-scm.org/D12270
author Augie Fackler <augie@google.com>
date Wed, 02 Mar 2022 10:07:21 -0500
parents 726b3601a534
children 1371c18e467d
files setup.py
diffstat 1 files changed, 4 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Wed Mar 02 10:06:37 2022 -0500
+++ b/setup.py	Wed Mar 02 10:07:21 2022 -0500
@@ -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