Skip to content

Commit 634a143

Browse files
committed
gn build: Fix a Python2ism in write_vcsrevision.py.
Convert the output of "git rev-parse --short HEAD" to a string before substituting it into the output file. Without this the output file will look like this on Python 3: #define LLVM_REVISION "git-b'6a4895a025f'" Differential Revision: https://reviews.llvm.org/D56459 llvm-svn: 350686
1 parent 9479f6d commit 634a143

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/gn/build/write_vcsrevision.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def main():
5252
git = which('git.bat')
5353
use_shell = True
5454
rev = subprocess.check_output([git, 'rev-parse', '--short', 'HEAD'],
55-
cwd=git_dir, shell=use_shell)
55+
cwd=git_dir, shell=use_shell).decode().strip()
5656
# FIXME: add pizzas such as the svn revision read off a git note?
57-
vcsrevision_contents = '#define LLVM_REVISION "git-%s"\n' % rev.strip()
57+
vcsrevision_contents = '#define LLVM_REVISION "git-%s"\n' % rev
5858

5959
# If the output already exists and is identical to what we'd write,
6060
# return to not perturb the existing file's timestamp.

0 commit comments

Comments
 (0)