Merge branch 'setup-version-check' of https://github.com/keszybz/calibre

This commit is contained in:
Kovid Goyal 2021-09-30 13:20:20 +05:30
commit bc61cf92d2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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()