diff options
Diffstat (limited to 'git_command.py')
-rw-r--r-- | git_command.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/git_command.py b/git_command.py index 259fb02c..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): |
@@ -263,6 +266,8 @@ class GitCommand(object): | |||
263 | if not buf: | 266 | if not buf: |
264 | s_in.remove(s) | 267 | s_in.remove(s) |
265 | continue | 268 | continue |
269 | if not hasattr(buf, 'encode'): | ||
270 | buf = buf.decode() | ||
266 | if s.std_name == 'stdout': | 271 | if s.std_name == 'stdout': |
267 | self.stdout += buf | 272 | self.stdout += buf |
268 | else: | 273 | else: |