Setup env explicitly on Windows

This commit is contained in:
Thaddeus Crews 2024-07-21 11:48:45 -05:00
parent faa6f8c70c
commit b3cd575278
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84

View file

@ -81,6 +81,8 @@ class CalledProcessError(RuntimeError):
def _setdefault_kwargs(kwargs: dict[str, Any]) -> None:
for arg in ('stdin', 'stdout', 'stderr'):
kwargs.setdefault(arg, subprocess.PIPE)
if sys.platform == 'win32':
kwargs.setdefault('env', os.environ)
def _oserror_to_output(e: OSError) -> tuple[int, bytes, None]: