Skip to content

Commit

Permalink
Update version info script to use python3
Browse files Browse the repository at this point in the history
  • Loading branch information
pjotrp committed Oct 3, 2018
1 parent c603c8c commit b1d59fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -64,7 +64,7 @@ htslib-static:
cd htslib && $(MAKE)

ldc-version-info:
python ./gen_ldc_version_info.py $(shell which ldmd2) > utils/ldc_version_info_.d
python3 ./gen_ldc_version_info.py $(shell which ldmd2) > utils/ldc_version_info_.d
cat utils/ldc_version_info_.d

utils/ldc_version_info_.o: ldc-version-info
Expand Down
4 changes: 2 additions & 2 deletions gen_ldc_version_info.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python

from __future__ import print_function
import re, sys, subprocess
Expand All @@ -10,7 +10,7 @@
ldc = sys.argv[1].replace("ldmd2", "ldc2")
ldc_output = subprocess.Popen([ldc, '-version'], stdout=subprocess.PIPE).communicate()[0]
version_re = r"""^.+\((?P<LDC>[^\)]+)\):\n\s*based on DMD (?P<DMD>\S+) and LLVM (?P<LLVM>\S+)\n(?:\s*built with (?P<BOOTSTRAP>.*)\n)?"""
match = re.match(version_re, ldc_output, re.MULTILINE)
match = re.match(version_re, ldc_output.decode("utf-8") , re.MULTILINE)

if not match:
sys.exit("ERROR: failed to generated LDC version information")
Expand Down

0 comments on commit b1d59fe

Please sign in to comment.