From 59b5e200a527d5b06223053005c766b653a6142e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 25 Sep 2025 09:32:23 +0200 Subject: [PATCH] typing --- nix/build-all.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/build-all.py b/nix/build-all.py index fa6fbe0048..392ebf3648 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -188,8 +188,10 @@ def cecho(message, color=NO_COLOR): logger.info(f"{color}{message}\033[0m") -def which(cmd): - for path in os.getenv("PATH").split(":"): +def which(cmd: str) -> Union[str, None]: + PATH = os.getenv("PATH") + assert PATH + for path in PATH.split(":"): if os.path.exists(path) and cmd in os.listdir(path): return cmd return None