validate:launcher: Handle git error properly
authorYoung Han Lee <y.lee@lge.com>
Wed, 15 Apr 2015 05:02:32 +0000 (14:02 +0900)
committerThibault Saunier <thibault.saunier@collabora.com>
Wed, 15 Apr 2015 09:36:28 +0000 (11:36 +0200)
'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

validate/tools/gst-validate-launcher.in

index b6f2031..e165f3a 100644 (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)