From fa8e4de5c31dc7dceb3f12143aab0d1c46cdb080 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 22 Oct 2025 11:52:40 +0200 Subject: [PATCH] ci: Use os.environ[key] access when value must be set The other code in this file is using this pattern to throw when a key is unset, instead of silently returning a None when using os.getenv(key) with no default value specified. So use the pattern here as well. As the env vars are always set, this should be a refactor that does not change the behavior. --- ci/test/02_run_container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test/02_run_container.py b/ci/test/02_run_container.py index c1c6b940d72..166acad7119 100755 --- a/ci/test/02_run_container.py +++ b/ci/test/02_run_container.py @@ -36,8 +36,8 @@ def main(): # Append $USER to /tmp/env to support multi-user systems and $CONTAINER_NAME # to allow support starting multiple runs simultaneously by the same user. env_file = "/tmp/env-{u}-{c}".format( - u=os.getenv("USER"), - c=os.getenv("CONTAINER_NAME"), + u=os.environ["USER"], + c=os.environ["CONTAINER_NAME"], ) with open(env_file, "w", encoding="utf8") as file: for k, v in os.environ.items():