From f54d20c3a1f8386fd98196444934fe773556cb79 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 3 Mar 2025 00:33:39 +0100 Subject: [PATCH] maintainers/scripts/update: Do not try to print error when there is not one This can happen e.g. due to an error during `merge_changes` since we do not do `stderr=PIPE` for git commands. --- maintainers/scripts/update.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/maintainers/scripts/update.py b/maintainers/scripts/update.py index 40fe70fb4c56..36a6c7218896 100644 --- a/maintainers/scripts/update.py +++ b/maintainers/scripts/update.py @@ -93,14 +93,19 @@ async def run_update_script( raise asyncio.exceptions.CancelledError() except CalledProcessError as e: eprint(f" - {package['name']}: ERROR") - eprint() - eprint(f"--- SHOWING ERROR LOG FOR {package['name']} ----------------------") - eprint() - eprint(e.stderr.decode("utf-8")) - with open(f"{package['pname']}.log", "wb") as logfile: - logfile.write(e.stderr) - eprint() - eprint(f"--- SHOWING ERROR LOG FOR {package['name']} ----------------------") + if e.stderr is not None: + eprint() + eprint( + f"--- SHOWING ERROR LOG FOR {package['name']} ----------------------" + ) + eprint() + eprint(e.stderr.decode("utf-8")) + with open(f"{package['pname']}.log", "wb") as logfile: + logfile.write(e.stderr) + eprint() + eprint( + f"--- SHOWING ERROR LOG FOR {package['name']} ----------------------" + ) if not keep_going: raise UpdateFailedException(