mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
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.
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user