mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 18:06:13 +01:00
Merge pull request #1063 from dmach/git-version-fix
Fix crash in determining git version when git command is not available
This commit is contained in:
commit
76d5d56b93
@ -24,7 +24,11 @@ def get_git_version():
|
||||
# run the command from the place where this file is placed
|
||||
# to ensure that we're in a git repo
|
||||
cwd = os.path.dirname(__file__)
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
|
||||
try:
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
|
||||
except OSError:
|
||||
# `git` command not found
|
||||
return None
|
||||
stdout, _ = proc.communicate()
|
||||
|
||||
if proc.returncode != 0:
|
||||
|
Loading…
Reference in New Issue
Block a user