From 32355cb29b4bf98cef18ea661d96c520f22bfd0a Mon Sep 17 00:00:00 2001 From: tguinot <thomas.guinot@gmail.com> Date: Tue, 11 Feb 2020 00:53:50 +0100 Subject: [PATCH] Clean leftovers --- libmat2/bubblewrap.py | 7 +------ libmat2/exiftool.py | 12 +----------- libmat2/video.py | 7 +------ 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/libmat2/bubblewrap.py b/libmat2/bubblewrap.py index b859cf7..38e8be1 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 091213a..85fe65e 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 f513e61..67f4016 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") -- GitLab