summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-01-30 10:10:45 +0200
committerLars Wirzenius <liw@liw.fi>2021-01-30 11:52:11 +0200
commit652cfdf094736d8a53b9176e9a2d574c8c73cc9f (patch)
tree4c71949897449770fc27410895e68b9628fa3494
parentf32ba06142fab3285f0104492b1d97ef5c60c38a (diff)
downloadewww-652cfdf094736d8a53b9176e9a2d574c8c73cc9f.tar.gz
chore: update runcmd.py from Subplot
-rw-r--r--subplot/vendored/runcmd.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/subplot/vendored/runcmd.py b/subplot/vendored/runcmd.py
index 532b60b..a2564c6 100644
--- a/subplot/vendored/runcmd.py
+++ b/subplot/vendored/runcmd.py
@@ -49,7 +49,16 @@ def runcmd_get_argv(ctx):
# ctx context.
def runcmd_run(ctx, argv, **kwargs):
ns = ctx.declare("_runcmd")
+
+ # The Subplot Python template empties os.environ at startup, modulo a small
+ # number of variables with carefully chosen values. Here, we don't need to
+ # care about what those variables are, but we do need to not overwrite
+ # them, so we just add anything in the env keyword argument, if any, to
+ # os.environ.
env = dict(os.environ)
+ for key, arg in kwargs.pop("env", {}).items():
+ env[key] = arg
+
pp = ns.get("path-prefix")
if pp:
env["PATH"] = pp + ":" + env["PATH"]