mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 04:47:48 +08:00
添加运行环境检测
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user