From 243df2042ed756e7829cd39d3ebe3d1919444d5d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 21 Mar 2025 23:27:05 -0400 Subject: 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 Tested-by: Mike Frysinger Commit-Queue: Mike Frysinger --- repo | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'repo') diff --git a/repo b/repo index 85825e80..d9e28ab0 100755 --- a/repo +++ b/repo @@ -124,7 +124,7 @@ if not REPO_REV: BUG_URL = "https://issues.gerritcodereview.com/issues/new?component=1370071" # increment this whenever we make important changes to this script -VERSION = (2, 50) +VERSION = (2, 54) # increment this if the MAINTAINER_KEYS block is modified KEYRING_VERSION = (2, 3) @@ -483,11 +483,6 @@ def InitParser(parser): # This is a poor replacement for subprocess.run until we require Python 3.6+. -RunResult = collections.namedtuple( - "RunResult", ("returncode", "stdout", "stderr") -) - - class RunError(Exception): """Error when running a command failed.""" @@ -526,7 +521,9 @@ def run_command(cmd, **kwargs): elif stderr == subprocess.STDOUT: dbg += " 2>&1" trace.print(dbg) - ret = RunResult(proc.returncode, decode(stdout), decode(stderr)) + ret = subprocess.CompletedProcess( + cmd, proc.returncode, decode(stdout), decode(stderr) + ) # If things failed, print useful debugging output. if check and ret.returncode: @@ -553,7 +550,6 @@ def run_command(cmd, **kwargs): class CloneFailure(Exception): - """Indicate the remote clone of repo itself failed.""" -- cgit v1.2.3-54-g00ecf