feat: check environment, python version must be greater than or equal to 3.9
This commit is contained in:
13
check_env/__init__.py
Normal file
13
check_env/__init__.py
Normal 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)
|
||||||
Reference in New Issue
Block a user