mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Merge branch 'setup-version-check' of https://github.com/keszybz/calibre
This commit is contained in:
commit
bc61cf92d2
10
setup.py
10
setup.py
@ -9,12 +9,12 @@ __docformat__ = 'restructuredtext en'
|
|||||||
import sys, os
|
import sys, os
|
||||||
|
|
||||||
|
|
||||||
def check_version_info():
|
def check_version_info(minver=(3, 7, 0)):
|
||||||
vi = sys.version_info
|
vi = sys.version_info
|
||||||
if vi.major > 3 or (vi.major == 3 and vi[1:3] >= (7, 0)):
|
if vi < minver:
|
||||||
return
|
def fmt(v):
|
||||||
raise SystemExit(
|
return '.'.join(map(str, v[:3]))
|
||||||
'calibre requires python >= 3.7.0. Current python version: ' + '.'.join(map(str, vi[:3])))
|
exit(f'calibre requires Python >= {fmt(minver)}. Current Python version: {fmt(vi)}')
|
||||||
|
|
||||||
|
|
||||||
check_version_info()
|
check_version_info()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user