Skip to content

Commit dbb6d80

Browse files
committed
Route warnings and error messages to stderr, not stdout.
1 parent a99726f commit dbb6d80

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

cibuildwheel/logger.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,18 @@ def step_end_with_error(self, error: Union[BaseException, str]) -> None:
116116
self.error(error)
117117

118118
def warning(self, message: str) -> None:
119-
print()
120-
121119
if self.fold_mode == 'github':
122-
print(f'::warning::{message}')
120+
print(f'::warning::{message}\n', file=sys.stderr)
123121
else:
124122
c = self.colors
125-
print(f'{c.yellow}Warning{c.end} {message}')
126-
127-
print()
123+
print(f'{c.yellow}Warning{c.end}: {message}\n', file=sys.stderr)
128124

129125
def error(self, error: Union[BaseException, str]) -> None:
130-
print()
131-
132126
if self.fold_mode == 'github':
133-
print(f'::error::{error}')
127+
print(f'::error::{error}\n', file=sys.stderr)
134128
else:
135129
c = self.colors
136-
print(f'{c.bright_red}Error{c.end} {error}')
137-
138-
print()
130+
print(f'{c.bright_red}Error{c.end}: {error}\n', file=sys.stderr)
139131

140132
def _start_fold_group(self, name: str) -> None:
141133
self._end_fold_group()

test/utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ def cibuildwheel_get_build_identifiers(project_path, env=None):
3737
env=env,
3838
)
3939

40-
lines = cmd_output.strip().split('\n')
41-
42-
# ignore warning lines in output
43-
return [l for l in lines if l != '' and not l.startswith('Warning ')]
40+
return cmd_output.strip().split('\n')
4441

4542

4643
def cibuildwheel_run(project_path, package_dir='.', env=None, add_env=None, output_dir=None):

0 commit comments

Comments
 (0)