diff --git a/libmat2/bubblewrap.py b/libmat2/bubblewrap.py index b859cf7dfb43e04da156ca99f89b7b35c58a2e1d..38e8be137613785c0dcf685983411b96a67eb7f5 100644 --- a/libmat2/bubblewrap.py +++ b/libmat2/bubblewrap.py @@ -23,14 +23,9 @@ CalledProcessError = subprocess.CalledProcessError def _get_bwrap_path() -> str: which_path = shutil.which('bwrap') - if which_path is not None and os.access(which_path, os.X_OK): + if which_path is not None: return which_path - bwrap_path = '/usr/bin/bwrap' - if os.path.isfile(bwrap_path): - if os.access(bwrap_path, os.X_OK): - return bwrap_path - raise RuntimeError("Unable to find bwrap") # pragma: no cover diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py index 091213a98b0596d390c54e492823e5e8de94d6fb..85fe65ef0ee2da2c36419390814f705e241a2247 100644 --- a/libmat2/exiftool.py +++ b/libmat2/exiftool.py @@ -73,17 +73,7 @@ class ExiftoolParser(abstract.AbstractParser): @functools.lru_cache() def _get_exiftool_path() -> str: # pragma: no cover which_path = shutil.which('exiftool') - if which_path is not None and os.access(which_path, os.X_OK): + if which_path is not None: return which_path - possible_pathes = { - '/usr/bin/exiftool', # debian/fedora - '/usr/bin/vendor_perl/exiftool', # archlinux - } - - for possible_path in possible_pathes: - if os.path.isfile(possible_path): - if os.access(possible_path, os.X_OK): - return possible_path - raise RuntimeError("Unable to find exiftool") diff --git a/libmat2/video.py b/libmat2/video.py index f513e61b249c920c4b1d1ea46bceedb66982af91..67f401683e17effb00113bc68db68a09db527994 100644 --- a/libmat2/video.py +++ b/libmat2/video.py @@ -139,12 +139,7 @@ class MP4Parser(AbstractFFmpegParser): @functools.lru_cache() def _get_ffmpeg_path() -> str: # pragma: no cover which_path = shutil.which('ffmpeg') - if which_path is not None and os.access(which_path, os.X_OK): + if which_path is not None: return which_path - ffmpeg_path = '/usr/bin/ffmpeg' - if os.path.isfile(ffmpeg_path): - if os.access(ffmpeg_path, os.X_OK): - return ffmpeg_path - raise RuntimeError("Unable to find ffmpeg")