mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
sync: use subprocess.run to verify tags
The code is a bit simpler & easier to reason about. Change-Id: I149729c7d01434b08b58cc9715dcf0f0d11201c2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/297022 Reviewed-by: Michael Mortensen <mmortensen@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
21dce3d8b3
commit
fb21d6ab64
@ -1086,20 +1086,11 @@ def _VerifyTag(project):
|
|||||||
env['GNUPGHOME'] = gpg_dir
|
env['GNUPGHOME'] = gpg_dir
|
||||||
|
|
||||||
cmd = [GIT, 'tag', '-v', cur]
|
cmd = [GIT, 'tag', '-v', cur]
|
||||||
proc = subprocess.Popen(cmd,
|
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||||
stdout=subprocess.PIPE,
|
env=env, check=False)
|
||||||
stderr=subprocess.PIPE,
|
if result.returncode:
|
||||||
env=env)
|
|
||||||
out = proc.stdout.read()
|
|
||||||
proc.stdout.close()
|
|
||||||
|
|
||||||
err = proc.stderr.read()
|
|
||||||
proc.stderr.close()
|
|
||||||
|
|
||||||
if proc.wait() != 0:
|
|
||||||
print(file=sys.stderr)
|
print(file=sys.stderr)
|
||||||
print(out, file=sys.stderr)
|
print(result.stdout, file=sys.stderr)
|
||||||
print(err, file=sys.stderr)
|
|
||||||
print(file=sys.stderr)
|
print(file=sys.stderr)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user