From 3371925d558ecd4fe02b05986f1c6d04f2272f30 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 2 Sep 2026 20:44:57 +0800 Subject: [PATCH] fix: restore mypy ratchet after Windows updates --- app/main.py | 2 +- app/runtime/state.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index c85fdc669..c525d1026 100644 --- a/app/main.py +++ b/app/main.py @@ -8,7 +8,7 @@ import sys if os.name == "nt": psql_exe = shutil.which("psql") if psql_exe: - os.add_dll_directory(os.path.dirname(psql_exe)) + getattr(os, "add_dll_directory")(os.path.dirname(psql_exe)) def _prepare_direct_execution_import_path() -> None: """ diff --git a/app/runtime/state.py b/app/runtime/state.py index 8042e6de6..5244204e3 100644 --- a/app/runtime/state.py +++ b/app/runtime/state.py @@ -251,7 +251,8 @@ class SystemHelper(ConfigReloadMixin): """ 执行Windows重启操作 """ - def cmd(command: list) -> Tuple[bool, str]: + def cmd(command: list[str]) -> Tuple[bool, str]: + """通过 Windows 命令解释器执行重启命令。""" try: subprocess.run(command, shell=True) return True, ""