Răsfoiți Sursa

git_command: only decode when needed

strings no longer need decoding, since unicode is str

Change-Id: I9516d298fee7ddc058452394b7759327fe3aa7a8
Anthony King 10 ani în urmă
părinte
comite
cf738ed4a1
1 a modificat fișierele cu 4 adăugiri și 1 ștergeri
  1. 4 1
      git_command.py

+ 4 - 1
git_command.py

@@ -92,7 +92,10 @@ class _GitCall(object):
   def version(self):
     p = GitCommand(None, ['--version'], capture_stdout=True)
     if p.Wait() == 0:
-      return p.stdout.decode('utf-8')
+      if hasattr(p.stdout, 'decode'):
+        return p.stdout.decode('utf-8')
+      else:
+        return p.stdout
     return None
 
   def version_tuple(self):