decode command output for python 3 support
Change-Id: I01cf870d47c1ae6e792a23a76fb272ed338eb59c Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
bb5a5cf765
commit
3284c05947
|
@ -49,13 +49,13 @@ def main():
|
|||
try:
|
||||
ref_hash = subprocess.check_output(
|
||||
['git', 'show-ref', '-s', ref]
|
||||
).rstrip()
|
||||
).decode('utf-8').rstrip()
|
||||
except subprocess.CalledProcessError:
|
||||
# Maybe they gave us a commit id
|
||||
try:
|
||||
ref_hash = subprocess.check_output(
|
||||
['git', 'show', '--pretty=format:%H', '--quiet', ref]
|
||||
).rstrip()
|
||||
).decode('utf-8').rstrip()
|
||||
except subprocess.CalledProcessError:
|
||||
sys.stderr.write('Could not get hash for ref %r\n' % ref)
|
||||
return 1
|
||||
|
|
Loading…
Reference in New Issue