From df0ca9b396ea6fe333dfea31428c5cf0ad0d09ca Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 07:56:56 +0100 Subject: [PATCH] Remove redundant subprocess option handling Architecture-Review: unchanged; subprocess I/O and environment semantics stay the same. Co-Authored-By: Codex --- src/loopzero/_proc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/loopzero/_proc.py b/src/loopzero/_proc.py index 3bfaf9a0..8ac581fa 100644 --- a/src/loopzero/_proc.py +++ b/src/loopzero/_proc.py @@ -100,8 +100,7 @@ def build_env( ) -> dict[str, str]: """Copy only allowlisted variables from the current environment, then apply extras.""" env = {key: os.environ[key] for key in env_allowlist if key in os.environ} - if extra_env: - env.update(extra_env) + env.update(extra_env or {}) return env @@ -138,7 +137,6 @@ def run( stdin=subprocess.PIPE if input is not None else subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT if merge_output else subprocess.PIPE, - text=not preserve_newlines, encoding=None if preserve_newlines else encoding, errors=None if preserve_newlines else "replace", start_new_session=os.name == "posix",