From 3f21a0672d1e90da49a96cf9cc73056521038d9e Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Fri, 7 Mar 2014 21:08:38 +0800 Subject: [PATCH] avoid zombie git process --- src/you_get/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/you_get/common.py b/src/you_get/common.py index a440b580..3f3a29eb 100644 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -787,7 +787,7 @@ def get_version(): try: import subprocess real_dir = os.path.dirname(os.path.realpath(__file__)) - git_hash = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'], cwd=real_dir, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL).stdout.read().decode('utf-8').strip() + git_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=real_dir, stderr=subprocess.DEVNULL).decode('utf-8').strip() assert git_hash return '%s-%s' % (__version__, git_hash) except: