Fix tools/review for python3.

This commit is contained in:
Steve Howell 2017-08-17 17:39:35 -04:00
parent 919ca3431f
commit c26e000d4e
1 changed files with 6 additions and 2 deletions

View File

@ -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)