Skip to content
Merged
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
19 changes: 9 additions & 10 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,23 +339,22 @@ def checkdep_dvipng():
return None

def checkdep_ghostscript():
try:
if sys.platform == 'win32':
gs_execs = ['gswin32c', 'gswin64c', 'gs']
else:
gs_execs = ['gs']
for gs_exec in gs_execs:
if sys.platform == 'win32':
gs_execs = ['gswin32c', 'gswin64c', 'gs']
else:
gs_execs = ['gs']
for gs_exec in gs_execs:
try:
s = subprocess.Popen(
[gs_exec, '--version'], stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = s.communicate()
if s.returncode == 0:
v = byte2str(stdout[:-1])
return gs_exec, v

return None, None
except (IndexError, ValueError, OSError):
return None, None
except (IndexError, ValueError, OSError):
pass
return None, None

def checkdep_tex():
try:
Expand Down