Fix the corner case in version generation script.
authorLei Zhang <antiagainst@google.com>
Fri, 11 Mar 2016 20:03:04 +0000 (15:03 -0500)
committerLei Zhang <antiagainst@google.com>
Fri, 11 Mar 2016 20:06:15 +0000 (15:06 -0500)
When the given directory is not inside the SPIRV-Tools project,
describe() returns a str instance instead of bytes instance
in Python3, which will case problem when calling decode() on it.

utils/update_build_version.py

index 16232f8..69b4289 100755 (executable)
@@ -62,7 +62,8 @@ def describe(dir):
         try:
             return command_output(['git', 'rev-parse', 'HEAD'], dir).rstrip()
         except:
-            return 'unknown hash, ' + datetime.date.today().isoformat()
+            return 'unknown hash, {}'.format(
+                datetime.date.today().isoformat()).encode('ascii')
 
 
 def main():