From 2d5322a6458e9000348af0f4c83fe76e72626b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 30 Sep 2021 08:55:16 +0200 Subject: [PATCH] setup: simplify version check A tuple comparison is equivalent to the more complicated check, and exit() is the same as raise SystemExit(). --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index bfcbc49d2c..0cb2f19e9f 100755 --- a/setup.py +++ b/setup.py @@ -11,10 +11,8 @@ import sys, os def check_version_info(): vi = sys.version_info - if vi.major > 3 or (vi.major == 3 and vi[1:3] >= (7, 0)): - return - raise SystemExit( - 'calibre requires python >= 3.7.0. Current python version: ' + '.'.join(map(str, vi[:3]))) + if vi < (3, 7): + exit('calibre requires Python >= 3.7.0. Current Python version: ' + '.'.join(map(str, vi[:3]))) check_version_info()