Skip to content

Commit 73e5283

Browse files
committed
Merge pull request matplotlib#2470 from cgohlke/patch-3
ENH: use checkdep_ghostscript to determine ghostscript executable
2 parents 748f799 + 405ce9f commit 73e5283

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def _fn_name(): return sys._getframe(1).f_code.co_name
1717
from md5 import md5 #Deprecated in 2.5
1818

1919
from tempfile import mkstemp
20-
from matplotlib import verbose, __version__, rcParams
20+
from matplotlib import verbose, __version__, rcParams, checkdep_ghostscript
2121
from matplotlib._pylab_helpers import Gcf
2222
from matplotlib.afm import AFM
2323
from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\
@@ -70,8 +70,9 @@ def gs_exe(self):
7070
except KeyError:
7171
pass
7272

73-
if sys.platform == 'win32': gs_exe = 'gswin32c'
74-
else: gs_exe = 'gs'
73+
gs_exe, gs_version = checkdep_ghostscript()
74+
if gs_exe is None:
75+
gs_exe = 'gs'
7576

7677
self._cached["gs_exe"] = gs_exe
7778
return gs_exe
@@ -1617,8 +1618,7 @@ def get_bbox(tmpfile, bbox):
16171618
"""
16181619

16191620
outfile = tmpfile + '.output'
1620-
if sys.platform == 'win32': gs_exe = 'gswin32c'
1621-
else: gs_exe = 'gs'
1621+
gs_exe = ps_backend_helper.gs_exe
16221622
command = '%s -dBATCH -dNOPAUSE -sDEVICE=bbox "%s"' %\
16231623
(gs_exe, tmpfile)
16241624
verbose.report(command, 'debug')

0 commit comments

Comments
 (0)