From f6883430729d2587e4c35a04ada91a47434eab6e Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Mon, 23 Mar 2026 17:32:52 +0800 Subject: [PATCH] fix: remove incorrect startup suggestion from version check --- astrbot/__main__.py | 2 +- astrbot/cli/commands/cmd_run.py | 2 +- astrbot/core/computer/computer_client.py | 4 ++-- astrbot/core/computer/tools/fs.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/astrbot/__main__.py b/astrbot/__main__.py index b3ca09708..5404ed11f 100644 --- a/astrbot/__main__.py +++ b/astrbot/__main__.py @@ -48,7 +48,7 @@ def check_env() -> None: if not (sys.version_info.major == 3 and sys.version_info.minor in (12, 13)): print( f"❌ Python 版本错误: 当前使用 Python {sys.version_info.major}.{sys.version_info.minor}\n" - "请使用 uv tool install -e . --force -p 3.12 或 -p 3.13 重新安装", + "请使用 uv tool install -e . --force -p 3.12 重新安装", file=sys.stderr, ) sys.exit(1) diff --git a/astrbot/cli/commands/cmd_run.py b/astrbot/cli/commands/cmd_run.py index 4870e9628..495b43bf1 100644 --- a/astrbot/cli/commands/cmd_run.py +++ b/astrbot/cli/commands/cmd_run.py @@ -61,7 +61,7 @@ from astrbot.runtime_bootstrap import initialize_runtime_bootstrap if not (sys.version_info.major == 3 and sys.version_info.minor in (12, 13)): print( f"❌ Python 版本错误: 当前使用 Python {sys.version_info.major}.{sys.version_info.minor}\n" - "请使用 uv tool install -e . --force -p 3.12 或 -p 3.13 重新安装", + "请使用 uv tool install -e . --force -p 3.12 重新安装", file=sys.stderr, ) sys.exit(1) diff --git a/astrbot/core/computer/computer_client.py b/astrbot/core/computer/computer_client.py index 3698aaead..3a76f448b 100644 --- a/astrbot/core/computer/computer_client.py +++ b/astrbot/core/computer/computer_client.py @@ -430,9 +430,9 @@ async def _sync_skills_to_sandbox(booter: ComputerBooter) -> None: len(managed), ) finally: - if zip_path.exists(): + if await zip_path.exists(): try: - zip_path.unlink() + await zip_path.unlink() except Exception: logger.warning( "[Computer] sandbox_sync phase=cleanup status=failed path=%s", diff --git a/astrbot/core/computer/tools/fs.py b/astrbot/core/computer/tools/fs.py index 4e92c31ac..30e35ed53 100644 --- a/astrbot/core/computer/tools/fs.py +++ b/astrbot/core/computer/tools/fs.py @@ -109,7 +109,7 @@ class FileUploadTool(FunctionTool): self, context: ContextWrapper[AstrAgentContext], local_path: str, - ) -> str | None: + ) -> str: if permission_error := check_admin_permission(context, "File upload/download"): return permission_error sb = await get_booter(