aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/git/gen_git_source.py
diff options
context:
space:
mode:
authorGravatar Vijay Vasudevan <vrv@google.com>2016-11-03 17:07:01 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-11-03 18:24:53 -0700
commit818993c7751601527d662d2417f220e4e856e4ef (patch)
treea9cb33d6332f3e37d740cd6eb6984a1837714237 /tensorflow/tools/git/gen_git_source.py
parenta19c425536bba29997807bbbd5ed43386d3cb7bd (diff)
Merge changes from github.
Change: 138143557
Diffstat (limited to 'tensorflow/tools/git/gen_git_source.py')
-rwxr-xr-xtensorflow/tools/git/gen_git_source.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tensorflow/tools/git/gen_git_source.py b/tensorflow/tools/git/gen_git_source.py
index 267bcad816..adc6bdbd17 100755
--- a/tensorflow/tools/git/gen_git_source.py
+++ b/tensorflow/tools/git/gen_git_source.py
@@ -147,8 +147,10 @@ def get_git_version(git_base_path):
"""
unknown_label = b"unknown"
try:
- val = subprocess.check_output(["git", str("--git-dir="+git_base_path+"/.git"), str("--work-tree="+git_base_path), "describe",
- "--long", "--dirty", "--tags"]).strip()
+ val = bytes(subprocess.check_output([
+ "git", str("--git-dir=%s/.git" % git_base_path),
+ str("--work-tree=" + git_base_path), "describe", "--long", "--dirty", "--tags"
+ ]).strip())
return val if val else unknown_label
except subprocess.CalledProcessError:
return unknown_label
@@ -199,7 +201,7 @@ def generate(arglist):
data = json.load(open(spec))
git_version = None
if not data["git"]:
- git_version = "unknown"
+ git_version = b"unknown"
else:
old_branch = data["branch"]
new_branch = parse_branch_ref(head_symlink)