perf: pip_main wrapped in asyncio.to_thread

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Soulter
2025-05-31 11:47:29 +08:00
committed by GitHub
parent 0924835253
commit 18f919fb6b
+1 -1
View File
@@ -47,7 +47,7 @@ class PipInstaller:
except FileNotFoundError:
# 没有 pip
from pip import main as pip_main
result_code = pip_main(args)
result_code = await asyncio.to_thread(pip_main, args)
# 清除 pip.main 导致的多余的 logging handlers
for handler in logging.root.handlers[:]: