From 5d18c13f5ac36b5bdffa75596ba3ca1a33c9e798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=9A=E9=A3=8E?= <1074154071@qq.com> Date: Thu, 23 Jun 2022 02:40:16 +0800 Subject: [PATCH] Update checkenv.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复python版本判断错误 --- lib/checkenv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/checkenv.py b/lib/checkenv.py index e2ff0d4..3ad6edb 100644 --- a/lib/checkenv.py +++ b/lib/checkenv.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # author = EASY -import platform +import sys import os import time import requests @@ -11,7 +11,7 @@ class CheckEnv: def __init__(self): - self.pyVersion = platform.python_version() + self.pyVersion = sys.version_info self.path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) self.python_check() self.path_check() @@ -19,8 +19,8 @@ def __init__(self): self.update() def python_check(self): - if self.pyVersion < "3.6": - logging.error("此Python版本 ('{0}') 不兼容,成功运行程序你必须使用版本 >= 3.6 (访问 ‘https://www.python.org/downloads/".format(self.pyVersion)) + if self.pyVersion < (3, 6): + logging.error("此Python版本 ('{0}') 不兼容,成功运行程序你必须使用版本 >= 3.6 (访问 ‘https://www.python.org/downloads/".format(self.pyVersion[0]+'.'+self.pyVersion[1]+'.'+self.pyVersion[2])) exit(0) def path_check(self):