Use git rev-parse instead, more robust
This commit is contained in:
parent
fa064bf9cf
commit
2efa83bc4d
1 changed files with 1 additions and 2 deletions
3
setup.py
3
setup.py
|
|
@ -183,8 +183,7 @@ def init_env(
|
|||
sysconfig.get_config_var('CCSHARED')
|
||||
)
|
||||
if os.path.exists('.git'):
|
||||
head = open('.git/HEAD', 'r').read().split(':', 1)[-1].strip()
|
||||
rev = open('.git/' + head).read().split(':', 1)[-1].strip()
|
||||
rev = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8').strip()
|
||||
cflags.append('-DKITTY_VCS_REV="{}"'.format(rev))
|
||||
ldflags = os.environ.get(
|
||||
'OVERRIDE_LDFLAGS',
|
||||
|
|
|
|||
Loading…
Reference in a new issue