diff options
| author | tguinot | 2020-02-10 03:31:07 +0100 |
|---|---|---|
| committer | jvoisin | 2020-02-11 17:23:11 +0100 |
| commit | 56d2c4aa5fea506abb15d71b53aea23b9dd3398b (patch) | |
| tree | 16a35a9e88694e227584513d7b0e4a3499844e67 /libmat2/bubblewrap.py | |
| parent | 12f23e0150906ccfac03254276a6af4bbe74f7c8 (diff) | |
Add which pathfinding for executables
Diffstat (limited to 'libmat2/bubblewrap.py')
| -rw-r--r-- | libmat2/bubblewrap.py | 7 |
1 files changed, 3 insertions, 4 deletions
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 | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | def _get_bwrap_path() -> str: | 24 | def _get_bwrap_path() -> str: |
| 25 | bwrap_path = '/usr/bin/bwrap' | 25 | which_path = shutil.which('bwrap') |
| 26 | if os.path.isfile(bwrap_path): | 26 | if which_path: |
| 27 | if os.access(bwrap_path, os.X_OK): | 27 | return which_path |
| 28 | return bwrap_path | ||
| 29 | 28 | ||
| 30 | raise RuntimeError("Unable to find bwrap") # pragma: no cover | 29 | raise RuntimeError("Unable to find bwrap") # pragma: no cover |
| 31 | 30 | ||
