功能修复:修复依赖时异常卡死
This commit is contained in:
parent
478bcd5f43
commit
5cdf9d752f
1 changed files with 16 additions and 10 deletions
|
@ -125,18 +125,24 @@ class Api:
|
||||||
os._exit(0)
|
os._exit(0)
|
||||||
|
|
||||||
def rm_site_packages(self):
|
def rm_site_packages(self):
|
||||||
|
try:
|
||||||
site_packages_path = Path("./python/Lib/site-packages")
|
site_packages_path = Path("./python/Lib/site-packages")
|
||||||
if site_packages_path.exists():
|
if site_packages_path.exists():
|
||||||
rmtree(site_packages_path)
|
rmtree(site_packages_path)
|
||||||
return "site-packages目录移除成功"
|
return "site-packages目录移除成功"
|
||||||
return "python\\Lib\\site-packages目录不存在"
|
return "python\\Lib\\site-packages目录不存在"
|
||||||
|
except Exception as e:
|
||||||
|
return repr(e)
|
||||||
|
|
||||||
def rm_python_scripts(self):
|
def rm_python_scripts(self):
|
||||||
|
try:
|
||||||
python_scripts_path = Path("./python/Scripts")
|
python_scripts_path = Path("./python/Scripts")
|
||||||
if python_scripts_path.exists():
|
if python_scripts_path.exists():
|
||||||
rmtree(python_scripts_path)
|
rmtree(python_scripts_path)
|
||||||
return "Scripts目录移除成功"
|
return "Scripts目录移除成功"
|
||||||
return "python\\Scripts目录不存在"
|
return "python\\Scripts目录不存在"
|
||||||
|
except Exception as e:
|
||||||
|
return repr(e)
|
||||||
|
|
||||||
def run(self, command, cwd=None):
|
def run(self, command, cwd=None):
|
||||||
command = command_list[command]
|
command = command_list[command]
|
||||||
|
|
Loading…
Add table
Reference in a new issue