diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 81792d2dc68f..c0d3d1a00344 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -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)) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index ff818ab9eb06..8000fac764c5 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -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