From c46de6932ac95eb6086a24c6880553f27cf5be44 Mon Sep 17 00:00:00 2001 From: Chirayu Desai Date: Wed, 20 Aug 2014 09:34:10 +0530 Subject: [PATCH] Decode git version Used by 'repo --version' With Python 3, * Before: b'git version 2.1.0' * After: git version 2.1.0 Change-Id: I4321bb0f09e92cda1123c35910338b940e82a305 --- git_command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git_command.py b/git_command.py index 354fc715..53b3e75c 100644 --- a/git_command.py +++ b/git_command.py @@ -80,13 +80,13 @@ class _GitCall(object): def version(self): p = GitCommand(None, ['--version'], capture_stdout=True) if p.Wait() == 0: - return p.stdout + return p.stdout.decode('utf-8') return None def version_tuple(self): global _git_version if _git_version is None: - ver_str = git.version().decode('utf-8') + ver_str = git.version() _git_version = Wrapper().ParseGitVersion(ver_str) if _git_version is None: print('fatal: "%s" unsupported' % ver_str, file=sys.stderr)