mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-24 11:12:14 +01:00
Fix crash in determining git version when git command is not available
This commit is contained in:
parent
e6061da1d6
commit
fec667c70d
@ -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__)
|
||||
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…
x
Reference in New Issue
Block a user