Unsafe fixes.

This commit is contained in:
2026-05-25 02:12:31 +00:00
parent 95081ca50e
commit 54a4b57230
20 changed files with 55 additions and 81 deletions
+1 -1
View File
@@ -10,6 +10,6 @@ from buildutil import build
class CustomBuildHook(BuildHookInterface):
def initialize(self, version, build_data):
def initialize(self, version, build_data) -> None:
super().initialize(version, build_data)
build("frontend")
+1 -1
View File
@@ -178,7 +178,7 @@ def build(folder: str = "frontend") -> None:
logger.warning(e)
raise SystemExit(1)
def run(cmd):
def run(cmd) -> None:
display_cmd = [Path(cmd[0]).stem, *cmd[1:]]
logger.info("### %s", " ".join(display_cmd))
subprocess.run(cmd, check=True, cwd=folder)
+2 -2
View File
@@ -16,7 +16,7 @@ from fastapi_vue.hostutil import parse_endpoint
class ProcessGroup:
"""Manage async subprocesses with automatic cleanup, like TaskGroup for processes."""
def __init__(self):
def __init__(self) -> None:
self._procs: list[asyncio.subprocess.Process] = []
self._cmds: dict[int, str] = {} # pid -> command name
@@ -59,7 +59,7 @@ class ProcessGroup:
"""Wait for one process to exit, terminate others, then wait for all."""
await self._cleanup(immediate=exc_type is not None)
async def _cleanup(self, immediate: bool = False):
async def _cleanup(self, immediate: bool = False) -> None:
running = [p for p in self._procs if p.returncode is None]
if not running:
return