Use subprocess.Popen, hoping for Windows portability
Replaces use of subprocess.check_output
This commit is contained in:
Родитель
b6ccd0d891
Коммит
b38ac4bae6
|
@ -34,8 +34,10 @@ def describe(dir):
|
|||
"""Runs 'git describe' in dir. If successful, returns the output; otherwise,
|
||||
returns 'unknown hash, <date>'."""
|
||||
try:
|
||||
return subprocess.check_output(["git", "describe"], cwd=dir).rstrip()
|
||||
except subprocess.CalledProcessError:
|
||||
p = subprocess.Popen(["git", "describe"], stdout=subprocess.PIPE, cwd=dir)
|
||||
(stdout, _) = p.communicate()
|
||||
return stdout.rstrip()
|
||||
except:
|
||||
return 'unknown hash, ' + datetime.date.today().isoformat()
|
||||
|
||||
def main():
|
||||
|
|
Загрузка…
Ссылка в новой задаче