添加运行环境检测

This commit is contained in:
Jing Ling
2020-04-21 15:25:24 +08:00
parent 9c71ea54ba
commit 240422631e
2 changed files with 13 additions and 0 deletions
+12
View File
@@ -467,3 +467,15 @@ def delete_file(*paths):
path.unlink()
except Exception as e:
logger.log('ERROR', e.args)
def check_env():
system = platform.system()
implementation = platform.python_implementation()
if implementation != 'CPython':
logger.log('ALERT', f'当前Python是基于{implementation}实现但OneForAll只在CPython下测试通过')
if system == 'Windows' and implementation == 'CPython':
version = platform.python_version()
if version < '3.8':
logger.log('FATAL', 'OneForAll在Windows系统运行时需要Python 3.8以上版本')
exit(1)
+1
View File
@@ -222,6 +222,7 @@ class OneForAll(object):
:return: 总的子域结果
:rtype: list
"""
utils.check_env()
print(banner)
dt = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print(f'[*] Starting OneForAll @ {dt}\n')