From 56d2c4aa5fea506abb15d71b53aea23b9dd3398b Mon Sep 17 00:00:00 2001 From: tguinot Date: Mon, 10 Feb 2020 03:31:07 +0100 Subject: Add which pathfinding for executables --- libmat2/bubblewrap.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libmat2/bubblewrap.py') diff --git a/libmat2/bubblewrap.py b/libmat2/bubblewrap.py index 7a70635..8033d0a 100644 --- a/libmat2/bubblewrap.py +++ b/libmat2/bubblewrap.py @@ -22,10 +22,9 @@ CalledProcessError = subprocess.CalledProcessError def _get_bwrap_path() -> str: - bwrap_path = '/usr/bin/bwrap' - if os.path.isfile(bwrap_path): - if os.access(bwrap_path, os.X_OK): - return bwrap_path + which_path = shutil.which('bwrap') + if which_path: + return which_path raise RuntimeError("Unable to find bwrap") # pragma: no cover -- cgit v1.3