lib.Result: Fill "cmd" ctor parameter

Commands executed by ExecContext and its derived classes don't
populate the "cmd" parameter of "Result"'s constructor. Fixing that
makes for nicer error messages.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-06-13 04:43:34 +02:00
commit 048726a1aa
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -83,7 +83,7 @@ class Local(Base):
# PTY merges stdout/stderr
stdout = b''.join(stdout_chunks) if stdout_chunks else None
return Result(stdout, None, exit_code)
return Result(stdout, None, exit_code, cmd = cmd)
# -- non-interactive mode
@ -149,7 +149,7 @@ class Local(Base):
stdout = b''.join(stdout_parts) if stdout_parts else None
stderr = b''.join(stderr_parts) if stderr_parts else None
return Result(stdout, stderr, exit_code)
return Result(stdout, stderr, exit_code, cmd = cmd)
finally:
if cwd is not None: