validate:launcher: Handle git error properly

'OSError' exception is emitted but not handled properly when git is not
installed on running system.

https://bugzilla.gnome.org/show_bug.cgi?id=747892
This commit is contained in:
Young Han Lee 2015-04-15 14:02:32 +09:00 committed by Thibault Saunier
parent 8a6494ddf8
commit 102c13ed6f

View file

@ -30,7 +30,7 @@ def _get_git_first_hash(path):
try:
os.chdir(path)
res = subprocess.check_output(['git', 'rev-list', '--max-parents=0', 'HEAD']).rstrip('\n')
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, OSError):
res = ''
finally:
os.chdir(cdir)