mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
git_command: only decode when needed
strings no longer need decoding, since unicode is str Change-Id: I9516d298fee7ddc058452394b7759327fe3aa7a8
This commit is contained in:
parent
6cfc68e1e6
commit
cf738ed4a1
@ -92,7 +92,10 @@ class _GitCall(object):
|
|||||||
def version(self):
|
def version(self):
|
||||||
p = GitCommand(None, ['--version'], capture_stdout=True)
|
p = GitCommand(None, ['--version'], capture_stdout=True)
|
||||||
if p.Wait() == 0:
|
if p.Wait() == 0:
|
||||||
|
if hasattr(p.stdout, 'decode'):
|
||||||
return p.stdout.decode('utf-8')
|
return p.stdout.decode('utf-8')
|
||||||
|
else:
|
||||||
|
return p.stdout
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def version_tuple(self):
|
def version_tuple(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user