From e219c78fe595c09c5d5b7023ae59f465a61f46ff Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Wed, 30 Oct 2024 16:06:08 +0000 Subject: [PATCH] forall: Fix returning results early rc should be returned only after all results are processed. R=jojwang@google.com Bug: b/376454189 Change-Id: I8200b9954240dd3e8e9f2ab82494779a3cb38627 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/440901 Tested-by: Josip Sokcevic Commit-Queue: Josip Sokcevic Reviewed-by: Joanna Wang --- subcmds/forall.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subcmds/forall.py b/subcmds/forall.py index e5fc9e80..9da0c96e 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py @@ -279,7 +279,7 @@ without iterating through the remaining projects. rc = rc or r if r != 0 and opt.abort_on_errors: raise Exception("Aborting due to previous error") - return rc + return rc try: config = self.manifest.manifestProject.config @@ -298,7 +298,7 @@ without iterating through the remaining projects. ) except (KeyboardInterrupt, WorkerKeyboardInterrupt): # Catch KeyboardInterrupt raised inside and outside of workers - rc = rc or errno.EINTR + rc = errno.EINTR except Exception as e: # Catch any other exceptions raised logger.error( @@ -306,7 +306,7 @@ without iterating through the remaining projects. type(e).__name__, e, ) - rc = rc or getattr(e, "errno", 1) + rc = getattr(e, "errno", 1) if rc != 0: sys.exit(rc)