From 69e8e7cd1139ba8ac8f7cf60455e7aa427c5757e Mon Sep 17 00:00:00 2001 From: Krzysztof Majzerowicz-Jaszcz Date: Thu, 28 Apr 2022 11:41:08 +0000 Subject: [PATCH] Casctl: Python version check fix Fixes the python version check code in the casctl. Signed-off-by: Krzysztof Majzerowicz-Jaszcz --- utils/casctl | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/utils/casctl b/utils/casctl index d5bdd5e..902cc5d 100755 --- a/utils/casctl +++ b/utils/casctl @@ -3,20 +3,12 @@ # Copyright(c) 2012-2021 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # - -import platform import sys -min_ver = "3.6" -ver = platform.python_version() -if ver < min_ver: - print( - "Minimum required python version is {}. Detected python version is {}".format( - min_ver, - ver, - ), - file=sys.stderr, - ) +min_ver = (3, 6) +if sys.version_info < min_ver: + print("Minimum required python version is {}.{}. Detected python version is '{}'" + .format(*min_ver, sys.version), file=sys.stderr) exit(1) import argparse