summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2025-03-21 23:27:05 -0400
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2025-03-24 11:49:00 -0700
commit243df2042ed756e7829cd39d3ebe3d1919444d5d (patch)
tree3bbc1516dd4b28795b0e83fe2abbe14c3064d7b4 /repo
parent4b94e773efd36754f6c8649ad55b90d19a61107f (diff)
downloadgit-repo-243df2042ed756e7829cd39d3ebe3d1919444d5d.tar.gz
launcher: change RunResult to subprocess.CompletedProcess
Since we require Python 3.6 now in the launcher, swap out our custom RunResult class for the standard subprocess one. Change-Id: Idd8598df37c0a952d3ef828df6e250cab03c6589 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/462341 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'repo')
-rwxr-xr-xrepo12
1 files changed, 4 insertions, 8 deletions
diff --git a/repo b/repo
index 85825e80..d9e28ab0 100755
--- a/repo
+++ b/repo
@@ -124,7 +124,7 @@ if not REPO_REV:
124BUG_URL = "https://issues.gerritcodereview.com/issues/new?component=1370071" 124BUG_URL = "https://issues.gerritcodereview.com/issues/new?component=1370071"
125 125
126# increment this whenever we make important changes to this script 126# increment this whenever we make important changes to this script
127VERSION = (2, 50) 127VERSION = (2, 54)
128 128
129# increment this if the MAINTAINER_KEYS block is modified 129# increment this if the MAINTAINER_KEYS block is modified
130KEYRING_VERSION = (2, 3) 130KEYRING_VERSION = (2, 3)
@@ -483,11 +483,6 @@ def InitParser(parser):
483 483
484 484
485# This is a poor replacement for subprocess.run until we require Python 3.6+. 485# This is a poor replacement for subprocess.run until we require Python 3.6+.
486RunResult = collections.namedtuple(
487 "RunResult", ("returncode", "stdout", "stderr")
488)
489
490
491class RunError(Exception): 486class RunError(Exception):
492 """Error when running a command failed.""" 487 """Error when running a command failed."""
493 488
@@ -526,7 +521,9 @@ def run_command(cmd, **kwargs):
526 elif stderr == subprocess.STDOUT: 521 elif stderr == subprocess.STDOUT:
527 dbg += " 2>&1" 522 dbg += " 2>&1"
528 trace.print(dbg) 523 trace.print(dbg)
529 ret = RunResult(proc.returncode, decode(stdout), decode(stderr)) 524 ret = subprocess.CompletedProcess(
525 cmd, proc.returncode, decode(stdout), decode(stderr)
526 )
530 527
531 # If things failed, print useful debugging output. 528 # If things failed, print useful debugging output.
532 if check and ret.returncode: 529 if check and ret.returncode:
@@ -553,7 +550,6 @@ def run_command(cmd, **kwargs):
553 550
554 551
555class CloneFailure(Exception): 552class CloneFailure(Exception):
556
557 """Indicate the remote clone of repo itself failed.""" 553 """Indicate the remote clone of repo itself failed."""
558 554
559 555