From 321af37ee17ca1c821b33efa285ba67e794bc4d5 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Mon, 3 Oct 2016 09:08:24 -0700 Subject: Don't crash if valgrind or libtool are not installed. --- test/util.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test') 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', -- cgit v1.2.3