From 17b859fb7bdaff11c0e22b366a66623f9c5b6f6d Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Wed, 8 May 2024 01:24:09 -0700 Subject: [PATCH] gnulib-tool.py: Fix behavior of --test when a subprocess fails. Reported by Bruno Haible in . * pygnulib/main.py (main): Use sp.run with check=True so that an exception is thrown when a process fails. Simply exit if an exception occurs. --- ChangeLog | 9 +++++++++ pygnulib/main.py | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41a8ef7eb6..6d74b450bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-05-08 Collin Funk + + gnulib-tool.py: Fix behavior of --test when a subprocess fails. + Reported by Bruno Haible in + . + * pygnulib/main.py (main): Use sp.run with check=True so that an + exception is thrown when a process fails. Simply exit if an exception + occurs. + 2024-05-07 Collin Funk base32, base64: Prefer stdckdint to intprops. diff --git a/pygnulib/main.py b/pygnulib/main.py index 6e29374af2..128f25f9c1 100644 --- a/pygnulib/main.py +++ b/pygnulib/main.py @@ -1098,10 +1098,10 @@ def main(temp_directory: str) -> None: os.mkdir('build') os.chdir('build') try: # Try to execute commands - sp.call(['../configure']) - sp.call([UTILS['make']]) - sp.call([UTILS['make'], 'check']) - sp.call([UTILS['make'], 'distclean']) + sp.run(['../configure'], check=True) + sp.run([UTILS['make']], check=True) + sp.run([UTILS['make'], 'check'], check=True) + sp.run([UTILS['make'], 'distclean'], check=True) except Exception: sys.exit(1) args = ['find', '.', '-type', 'f', '-print'] -- 2.45.0