@@ -283,7 +283,7 @@ def wrapper():
283283_ExecInfo = namedtuple ("_ExecInfo" , "executable version" )
284284
285285
286- class ExecutableUnavailableError (FileNotFoundError ):
286+ class ExecutableNotFoundError (FileNotFoundError ):
287287 """Error raised when an executable that Matplotlib optionally
288288 depends on can't be found."""
289289 pass
@@ -313,7 +313,7 @@ def _get_executable_info(name):
313313
314314 Raises
315315 ------
316- ExecutableUnavailableError
316+ ExecutableNotFoundError
317317 If the executable is not found or older than the oldest version
318318 supported by Matplotlib.
319319 ValueError
@@ -325,27 +325,27 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
325325 # Search for a regex match in the output; if the match succeeds, the
326326 # first group of the match is the version.
327327 # Return an _ExecInfo if the executable exists, and has a version of
328- # at least min_ver (if set); else, raise ExecutableUnavailableError .
328+ # at least min_ver (if set); else, raise ExecutableNotFoundError .
329329 try :
330330 output = subprocess .check_output (
331331 args , stderr = subprocess .STDOUT , universal_newlines = True )
332332 except subprocess .CalledProcessError as _cpe :
333333 if ignore_exit_code :
334334 output = _cpe .output
335335 else :
336- raise ExecutableUnavailableError (str (_cpe )) from _cpe
336+ raise ExecutableNotFoundError (str (_cpe )) from _cpe
337337 except FileNotFoundError as _fnf :
338- raise ExecutableUnavailableError (str (_fnf )) from _fnf
338+ raise ExecutableNotFoundError (str (_fnf )) from _fnf
339339 match = re .search (regex , output )
340340 if match :
341341 version = LooseVersion (match .group (1 ))
342342 if min_ver is not None and version < min_ver :
343- raise ExecutableUnavailableError (
343+ raise ExecutableNotFoundError (
344344 f"You have { args [0 ]} version { version } but the minimum "
345345 f"version supported by Matplotlib is { min_ver } ." )
346346 return _ExecInfo (args [0 ], version )
347347 else :
348- raise ExecutableUnavailableError (
348+ raise ExecutableNotFoundError (
349349 f"Failed to determine the version of { args [0 ]} from "
350350 f"{ ' ' .join (args )} , which output { output } " )
351351
@@ -358,10 +358,10 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
358358 for e in execs :
359359 try :
360360 return impl ([e , "--version" ], "(.*)" , "9" )
361- except ExecutableUnavailableError :
361+ except ExecutableNotFoundError :
362362 pass
363363 message = "Failed to find a Ghostscript installation"
364- raise ExecutableUnavailableError (message )
364+ raise ExecutableNotFoundError (message )
365365 elif name == "inkscape" :
366366 return impl (["inkscape" , "-V" ], "^Inkscape ([^ ]*)" )
367367 elif name == "magick" :
@@ -389,7 +389,7 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
389389 else :
390390 path = "convert"
391391 if path is None :
392- raise ExecutableUnavailableError (
392+ raise ExecutableNotFoundError (
393393 "Failed to find an ImageMagick installation" )
394394 return impl ([path , "--version" ], r"^Version: ImageMagick (\S*)" )
395395 elif name == "pdftops" :
@@ -398,7 +398,7 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
398398 if info and not ("3.0" <= info .version
399399 # poppler version numbers.
400400 or "0.9" <= info .version <= "1.0" ):
401- raise ExecutableUnavailableError (
401+ raise ExecutableNotFoundError (
402402 f"You have pdftops version { info .version } but the minimum "
403403 f"version supported by Matplotlib is 3.0." )
404404 return info
@@ -487,14 +487,14 @@ def checkdep_ps_distiller(s):
487487 return False
488488 try :
489489 _get_executable_info ("gs" )
490- except ExecutableUnavailableError :
490+ except ExecutableNotFoundError :
491491 _log .warning (
492492 "Setting rcParams['ps.usedistiller'] requires ghostscript." )
493493 return False
494494 if s == "xpdf" :
495495 try :
496496 _get_executable_info ("pdftops" )
497- except ExecutableUnavailableError :
497+ except ExecutableNotFoundError :
498498 _log .warning (
499499 "Setting rcParams['ps.usedistiller'] to 'xpdf' requires xpdf." )
500500 return False
@@ -509,12 +509,12 @@ def checkdep_usetex(s):
509509 return False
510510 try :
511511 _get_executable_info ("dvipng" )
512- except ExecutableUnavailableError :
512+ except ExecutableNotFoundError :
513513 _log .warning ("usetex mode requires dvipng." )
514514 return False
515515 try :
516516 _get_executable_info ("gs" )
517- except ExecutableUnavailableError :
517+ except ExecutableNotFoundError :
518518 _log .warning ("usetex mode requires ghostscript." )
519519 return False
520520 return True
0 commit comments