Skip to content

Commit f53b7df

Browse files
committed
BUG: Fix incomplete handling of environment variable details in error messages of wheel_builder_utils.py
1 parent c841201 commit f53b7df

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎scripts/wheel_builder_utils.py‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,6 @@ def run_commandLine_subprocess(
226226
) -> subprocess.CompletedProcess:
227227
cmd = [str(x) for x in cmd]
228228
print(f"Running >>>>>: {' '.join(cmd)} ; # in cwd={cwd} with check={check}\n")
229-
# if env:
230-
# for k, v in env.items():
231-
# print(f"{k}={v}")
232229
completion_info = subprocess.run(
233230
cmd,
234231
cwd=str(cwd) if cwd else None,
@@ -238,10 +235,11 @@ def run_commandLine_subprocess(
238235
)
239236
if completion_info.returncode != 0 and check:
240237
error_msg = "!~" * 40
241-
error_msg += "ENVIRONMENT: ================="
242-
for k, v in env.items():
243-
error_msg += f"\n{k}={v}"
244-
error_msg += "=============================="
238+
if env:
239+
error_msg += "ENVIRONMENT: ================="
240+
for k, v in env.items():
241+
error_msg += f"\n{k}={v}"
242+
error_msg += "=============================="
245243
if completion_info.stdout:
246244
error_msg += f"\nStdout:\n {completion_info.stdout}"
247245
if completion_info.stderr:

0 commit comments

Comments
 (0)