bpo-45101: Add consistency in usage message IO between 2 versions of … · python/cpython@de2a73d · GitHub
Skip to content

Commit de2a73d

Browse files
authored
bpo-45101: Add consistency in usage message IO between 2 versions of python-config (GH-28162)
On --help output to stdout. On error output to stderr.
1 parent da382aa commit de2a73d

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions

Misc/python-config.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
1313

1414
def exit_with_usage(code=1):
1515
print("Usage: {0} [{1}]".format(
16-
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)), file=sys.stderr)
16+
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)),
17+
file=sys.stdout if code == 0 else sys.stderr)
1718
sys.exit(code)
1819

1920
try:

Misc/python-config.sh.in

Lines changed: 6 additions & 1 deletion

0 commit comments

Comments
 (0)