comparison setup.py @ 48826: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
comparison
equal deleted inserted replaced
48825:726b3601a534 48826:3ce8001fd768
20 ) 20 )
21 21
22 import sys, platform 22 import sys, platform
23 import sysconfig 23 import sysconfig
24 24
25 if sys.version_info[0] >= 3: 25 printf = eval('print')
26 printf = eval('print') 26 libdir_escape = 'unicode_escape'
27 libdir_escape = 'unicode_escape' 27
28 28
29 def sysstr(s): 29 def sysstr(s):
30 return s.decode('latin-1') 30 return s.decode('latin-1')
31
32 else:
33 libdir_escape = 'string_escape'
34
35 def printf(*args, **kwargs):
36 f = kwargs.get('file', sys.stdout)
37 end = kwargs.get('end', '\n')
38 f.write(b' '.join(args) + end)
39
40 def sysstr(s):
41 return s
42 31
43 32
44 import ssl 33 import ssl
45 34
46 # ssl.HAS_TLSv1* are preferred to check support but they were added in Python 35 # ssl.HAS_TLSv1* are preferred to check support but they were added in Python