feat: 添加工具以查找重复的异常处理,增强代码质量检查;新增验证 GUI 回退方式的自检脚本

This commit is contained in:
Your Name committed 2026-01-05 21:32:50 +08:00
1 parent 982357927e
commit 43e39f4db6
16 files changed
+472 -180

No files matched your search

+5 -2
View File
@@ -50,6 +50,7 @@ def list_adb_devices(adb_exe: str) -> list[str]:
text=True,
encoding="utf-8",
errors="replace",
check=False,
)
except FileNotFoundError:
return []
@@ -1020,13 +1021,13 @@ class Runner:
f"Python路径: {sys.executable}\n"
f"run_cli.py路径: {run_cli_path}\n"
f"原始错误: {e}"
)
) from e
except Exception as e:
raise RuntimeError(
f"启动进程失败:{e}\n"
f"命令: {' '.join(cmd)}\n"
f"工作目录: {path_config.PROJECT_ROOT}"
)
) from e
with self._lock:
self._proc = p
@@ -1127,6 +1128,7 @@ class Runner:
encoding="utf-8",
errors="replace",
timeout=5.0,
check=False,
)
if proc.returncode == 0:
@@ -1182,6 +1184,7 @@ class Runner:
["taskkill", "/PID", str(pid), "/T", "/F"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
check=False,
)
else:
# 类 Unix:尝试向进程组发送 SIGKILL