feat: check environment, python version must be greater than or equal to 3.9

This commit is contained in:
weiensong
2023-11-21 09:56:38 +08:00
parent e6d23d3ac9
commit c3b0ac72b2
2 changed files with 15 additions and 0 deletions

13
check_env/__init__.py Normal file
View File

@@ -0,0 +1,13 @@
import sys
class UnsupportedPythonVersionError(Exception):
def __init__(self, error_msg: str):
super().__init__(error_msg)
python_version_info = sys.version_info
if not sys.version_info >= (3, 9):
msg = "当前Python版本: " + ".".join(map(str, python_version_info[:3])) + (', 需要python版本 >= 3.9, 前往下载: '
'https://www.python.org/downloads/')
raise UnsupportedPythonVersionError(msg)

View File

@@ -2,6 +2,8 @@
# -*- coding: utf-8 -*-
import signal
import check_env
from argparse import ArgumentParser
from wcferry import Wcf