Commit d5e35c9d authored by Simon Shields's avatar Simon Shields
Browse files

repopick: fix --check-picked on Python 3

This is very subtly broken: we look for the string 'Change-Id:'
in an array of byte strings. Fix this by decoding the git output
to utf-8 strings.

Change-Id: I708ad0adacb61c89bfba0fd88eeb2e37648317af
parent 15d91cd2
......@@ -392,7 +392,11 @@ if __name__ == '__main__':
for i in range(0, check_picked_count):
if subprocess.call(['git', 'cat-file', '-e', 'HEAD~{0}'.format(i)], cwd=project_path, stderr=open(os.devnull, 'wb')):
continue
output = subprocess.check_output(['git', 'show', '-q', 'HEAD~{0}'.format(i)], cwd=project_path).split()
output = subprocess.check_output(['git', 'show', '-q', 'HEAD~{0}'.format(i)], cwd=project_path)
# make sure we have a string on Python 3
if isinstance(output, bytes):
output = output.decode('utf-8')
output = output.split()
if 'Change-Id:' in output:
head_change_id = ''
for j,t in enumerate(reversed(output)):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment