Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19d589c

Browse files
authored
Merge pull request #15413 from immaxchen/catch-os-err-instead-of-fnf-err-issue-15399
FIX: catch OSError instead of FileNotFoundError in _get_executable_info closes #15399
2 parents ca9a411 + 7f94eb2 commit 19d589c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
337337
output = _cpe.output
338338
else:
339339
raise ExecutableNotFoundError(str(_cpe)) from _cpe
340-
except FileNotFoundError as _fnf:
341-
raise ExecutableNotFoundError(str(_fnf)) from _fnf
340+
except OSError as _ose:
341+
raise ExecutableNotFoundError(str(_ose)) from _ose
342342
match = re.search(regex, output)
343343
if match:
344344
version = LooseVersion(match.group(1))

lib/matplotlib/animation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,8 +723,9 @@ def bin_path(cls):
723723
def isAvailable(cls):
724724
try:
725725
return super().isAvailable()
726-
except mpl.ExecutableNotFoundError:
726+
except mpl.ExecutableNotFoundError as _enf:
727727
# May be raised by get_executable_info.
728+
_log.debug('ImageMagick unavailable due to: %s', _enf)
728729
return False
729730

730731

0 commit comments

Comments
 (0)