Skip to content

catch OSError instead of FileNotFoundError in _get_executable_info to resolve #15399 #15413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
output = _cpe.output
else:
raise ExecutableNotFoundError(str(_cpe)) from _cpe
except FileNotFoundError as _fnf:
raise ExecutableNotFoundError(str(_fnf)) from _fnf
except OSError as _ose:
raise ExecutableNotFoundError(str(_ose)) from _ose
match = re.search(regex, output)
if match:
version = LooseVersion(match.group(1))
Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,9 @@ def bin_path(cls):
def isAvailable(cls):
try:
return super().isAvailable()
except mpl.ExecutableNotFoundError:
except mpl.ExecutableNotFoundError as _enf:
# May be raised by get_executable_info.
_log.debug('ImageMagick unavailable due to: %s', _enf)
return False


Expand Down