Skip to content

Commit a9b0f3b

Browse files
authored
Fix Windows failure (#2056)
1 parent 40aec48 commit a9b0f3b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/virtualenv/util/subprocess/_win_subprocess.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def _execute_child(
155155
args = args.decode('utf-8')
156156
startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW
157157
startupinfo.wShowWindow = _subprocess.SW_HIDE
158+
env = os.environ if env is None else env
158159
comspec = env.get("COMSPEC", unicode("cmd.exe"))
159160
if (
160161
_subprocess.GetVersion() >= 0x80000000 or

tests/unit/config/test___main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import absolute_import, unicode_literals
22

3-
import os
43
import re
54
import sys
65

@@ -91,8 +90,9 @@ def test_session_report_subprocess(session_app_data, tmp_path):
9190
# when called via a subprocess the logging framework should flush and POSIX line normalization happen
9291
out = subprocess.check_output(
9392
[sys.executable, "-m", "virtualenv", str(tmp_path), "--activators", "powershell", "--without-pip"],
93+
universal_newlines=True,
9494
)
95-
lines = out.decode().split(os.linesep)
95+
lines = out.split("\n")
9696
regexes = [
9797
r"created virtual environment .* in \d+ms",
9898
r" creator .*",

0 commit comments

Comments
 (0)