From ad5b5ec0c8c879678373dd210c00683ca5ee51dd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 Jul 2022 22:35:30 +0200 Subject: [PATCH] gnulib-tool.py: Write errors to stderr, not stdout. * pygnulib/constants.py: Write error messages to stderr, not stdout. --- ChangeLog | 3 +++ pygnulib/constants.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba5540243e..1d642ca30f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2022-07-31 Bruno Haible + gnulib-tool.py: Write errors to stderr, not stdout. + * pygnulib/constants.py: Write error messages to stderr, not stdout. + gnulib-tool.py: Use mainstream coding style. * pygnulib/GLConfig.py: Use 'raise' to re-throw an exception. diff --git a/pygnulib/constants.py b/pygnulib/constants.py index 10bd363f5b..91a2958eb3 100644 --- a/pygnulib/constants.py +++ b/pygnulib/constants.py @@ -213,7 +213,7 @@ def execute(args, verbose): try: # Try to run retcode = sp.call(args) except Exception as error: - print(error) + sys.stderr.write(str(error) + '\n') sys.exit(1) else: # Commands like automake produce output to stderr even when they succeed. @@ -223,7 +223,7 @@ def execute(args, verbose): try: # Try to run retcode = sp.call(xargs, shell=True) except Exception as error: - print(error) + sys.stderr.write(str(error) + '\n') sys.exit(1) if retcode == 0: os.remove(temp) -- 2.39.5