From: Nikolaus Rath Date: Mon, 3 Oct 2016 16:08:24 +0000 (-0700) Subject: Don't crash if valgrind or libtool are not installed. X-Git-Tag: fuse-3.0.0pre0~1 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=321af37ee17ca1c821b33efa285ba67e794bc4d5;p=qemu-gpiodev%2Flibfuse.git Don't crash if valgrind or libtool are not installed. --- diff --git a/test/util.py b/test/util.py index 5f2f3e0..e8bb9c2 100644 --- a/test/util.py +++ b/test/util.py @@ -40,9 +40,13 @@ def umount(mount_process, mnt_dir): # If valgrind and libtool are available, use them def has_program(name): - return subprocess.call([name, '--version'], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL) == 0 + try: + ret = subprocess.call([name, '--version'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + except FileNotFoundError: + return False + return ret == 0 if has_program('valgrind') and has_program('libtool'): base_cmdline = [ 'libtool', '--mode=execute',