From 66d1fc08b65ef1c13a9cdd764a12d9af45b7e3e1 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Sat, 13 May 2023 14:25:16 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=8E=BB=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/command/command.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/model/command/command.py b/model/command/command.py index 121ae7a17..d95f9d999 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -8,7 +8,8 @@ from model.provider.provider import Provider import json import util.plugin_util as putil import importlib -from pip._internal import main as pipmain +import shutil + PLATFORM_QQCHAN = 'qqchan' PLATFORM_GOCQ = 'gocq' @@ -110,7 +111,7 @@ class Command: return False, f"你的身份组{role}没有权限删除插件", "plugin" try: # 删除文件夹 - os.rmdir(os.path.join(ppath, l[2])) + shutil.rmtree(os.path.join(ppath, l[2])) if l[2] in self.cached_plugins: del self.cached_plugins[l[2]] return True, "插件卸载成功~", "plugin"