summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony King <anthonydking@slimroms.net>2015-06-03 16:50:39 +0100
committerAnthony King <anthonydking@slimroms.net>2015-06-03 16:50:39 +0100
commitcf738ed4a1acacc1dac5746ab3090f56c6f5df86 (patch)
tree32d7f056e01af700324e05d776fe172038eb055e
parent6cfc68e1e635162926d27f3421f1dbc729c55116 (diff)
downloadgit-repo-cf738ed4a1acacc1dac5746ab3090f56c6f5df86.tar.gz
git_command: only decode when needed
strings no longer need decoding, since unicode is str Change-Id: I9516d298fee7ddc058452394b7759327fe3aa7a8
-rw-r--r--git_command.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git_command.py b/git_command.py
index 3095fda1..0893bff7 100644
--- a/git_command.py
+++ b/git_command.py
@@ -92,7 +92,10 @@ class _GitCall(object):
92 def version(self): 92 def version(self):
93 p = GitCommand(None, ['--version'], capture_stdout=True) 93 p = GitCommand(None, ['--version'], capture_stdout=True)
94 if p.Wait() == 0: 94 if p.Wait() == 0:
95 return p.stdout.decode('utf-8') 95 if hasattr(p.stdout, 'decode'):
96 return p.stdout.decode('utf-8')
97 else:
98 return p.stdout
96 return None 99 return None
97 100
98 def version_tuple(self): 101 def version_tuple(self):