lib.ec.Local._run(): Interpret env as mod_env

An env argument environment passed to Local._run() entirely replaces
the environment. Make it modify the enviroment instead.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-17 18:35:48 +02:00
commit 64a5b5d429

View file

@ -75,6 +75,11 @@ class Local(Base):
# -- non-interactive mode # -- non-interactive mode
stdin = asyncio.subprocess.DEVNULL if cmd_input is None else asyncio.subprocess.PIPE stdin = asyncio.subprocess.DEVNULL if cmd_input is None else asyncio.subprocess.PIPE
if env:
new_env = os.environ.copy()
new_env.update(env)
env = new_env
proc = await asyncio.create_subprocess_exec( proc = await asyncio.create_subprocess_exec(
*cmd, *cmd,
stdin=stdin, stdin=stdin,