py3port: setup.py: check Python version
This commit is contained in:
parent
40fc0e4385
commit
489d637719
1 changed files with 8 additions and 0 deletions
8
setup.py
8
setup.py
|
|
@ -18,6 +18,14 @@
|
|||
|
||||
import sys,os,subprocess
|
||||
from shutil import copy2
|
||||
|
||||
ver = sys.version_info[:2]
|
||||
min_ver = (3,5)
|
||||
if ver[0] < min_ver[0] or ver[1] < min_ver[1]:
|
||||
m = '{}.{}: wrong Python version. MMGen requires Python {M}.{m} or greater\n'
|
||||
sys.stderr.write(m.format(*ver,M=min_ver[0],m=min_ver[1]))
|
||||
sys.exit(1)
|
||||
|
||||
_gvi = subprocess.check_output(['gcc','--version']).decode().splitlines()[0]
|
||||
have_mingw64 = 'x86_64' in _gvi and 'MinGW' in _gvi
|
||||
have_arm = subprocess.check_output(['uname','-m']).strip() == 'aarch64'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue