From c26e000d4ecf72230a42012a4b5ebaafc0118668 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 17 Aug 2017 17:39:35 -0400 Subject: [PATCH] Fix tools/review for python3. --- tools/review | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/review b/tools/review index 9033f8cd28..d90ef3fabe 100755 --- a/tools/review +++ b/tools/review @@ -15,16 +15,20 @@ def run(command): print('\n>>> ' + command) subprocess.check_call(command.split()) +def check_output(command): + # type: (str) -> str + return subprocess.check_output(command.split()).decode('ascii') + def get_git_branch(): # type: () -> str command = 'git rev-parse --abbrev-ref HEAD' - output = subprocess.check_output(command.split()) + output = check_output(command) return output.strip() def check_git_pristine(): # type: () -> None command = 'git status --porcelain' - output = subprocess.check_output(command.split()) + output = check_output(command) if output.strip(): exit('Git is not pristine:\n' + output)