##// END OF EJS Templates
hghave: drop py27 and py35 support...
Matt Harbison -
r51106:57133107 default
parent child Browse files
Show More
@@ -27,26 +27,17 b' except ImportError:'
27 27 stdout = getattr(sys.stdout, 'buffer', sys.stdout)
28 28 stderr = getattr(sys.stderr, 'buffer', sys.stderr)
29 29
30 is_not_python2 = sys.version_info[0] >= 3
31 if is_not_python2:
32 30
33 def _sys2bytes(p):
34 if p is None:
35 return p
36 return p.encode('utf-8')
37
38 def _bytes2sys(p):
39 if p is None:
40 return p
41 return p.decode('utf-8')
31 def _sys2bytes(p):
32 if p is None:
33 return p
34 return p.encode('utf-8')
42 35
43 36
44 else:
45
46 def _sys2bytes(p):
37 def _bytes2sys(p):
38 if p is None:
47 39 return p
48
49 _bytes2sys = _sys2bytes
40 return p.decode('utf-8')
50 41
51 42
52 43 def check(name, desc):
@@ -168,8 +159,6 b' def has_baz():'
168 159
169 160 @check("bzr", "Breezy library and executable version >= 3.1")
170 161 def has_bzr():
171 if not is_not_python2:
172 return False
173 162 try:
174 163 # Test the Breezy python lib
175 164 import breezy
@@ -877,9 +866,9 b' def has_demandimport():'
877 866 return (not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable'
878 867
879 868
880 # Add "py27", "py35", ... as possible feature checks. Note that there's no
869 # Add "py36", "py37", ... as possible feature checks. Note that there's no
881 870 # punctuation here.
882 @checkvers("py", "Python >= %s", (2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11))
871 @checkvers("py", "Python >= %s", (3.6, 3.7, 3.8, 3.9, 3.10, 3.11))
883 872 def has_python_range(v):
884 873 major, minor = v.split('.')[0:2]
885 874 py_major, py_minor = sys.version_info.major, sys.version_info.minor
@@ -897,7 +886,7 b' def has_python3exe():'
897 886 py = 'python3'
898 887 if os.name == 'nt':
899 888 py = 'py -3'
900 return matchoutput('%s -V' % py, br'^Python 3.(5|6|7|8|9|10|11)')
889 return matchoutput('%s -V' % py, br'^Python 3.(6|7|8|9|10|11)')
901 890
902 891
903 892 @check("pure", "running with pure Python code")
General Comments 0
You need to be logged in to leave comments. Login now