From b38ac4bae60b361ee6e7708fe89f93ccb535d1bc Mon Sep 17 00:00:00 2001 From: David Neto Date: Tue, 23 Feb 2016 17:58:31 -0500 Subject: [PATCH] Use subprocess.Popen, hoping for Windows portability Replaces use of subprocess.check_output --- utils/update_build_version.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/update_build_version.py b/utils/update_build_version.py index 0a624889..13efc262 100755 --- a/utils/update_build_version.py +++ b/utils/update_build_version.py @@ -34,8 +34,10 @@ def describe(dir): """Runs 'git describe' in dir. If successful, returns the output; otherwise, returns 'unknown hash, '.""" 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():