Skip to content

Commit 748f799

Browse files
committed
Merge pull request #2469 from cgohlke/patch-2
BUG: gswin64c.exe not detected on Windows
2 parents cb2e0b8 + 95a3bb7 commit 748f799

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lib/matplotlib/__init__.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -339,23 +339,22 @@ def checkdep_dvipng():
339339
return None
340340

341341
def checkdep_ghostscript():
342-
try:
343-
if sys.platform == 'win32':
344-
gs_execs = ['gswin32c', 'gswin64c', 'gs']
345-
else:
346-
gs_execs = ['gs']
347-
for gs_exec in gs_execs:
342+
if sys.platform == 'win32':
343+
gs_execs = ['gswin32c', 'gswin64c', 'gs']
344+
else:
345+
gs_execs = ['gs']
346+
for gs_exec in gs_execs:
347+
try:
348348
s = subprocess.Popen(
349349
[gs_exec, '--version'], stdout=subprocess.PIPE,
350350
stderr=subprocess.PIPE)
351351
stdout, stderr = s.communicate()
352352
if s.returncode == 0:
353353
v = byte2str(stdout[:-1])
354354
return gs_exec, v
355-
356-
return None, None
357-
except (IndexError, ValueError, OSError):
358-
return None, None
355+
except (IndexError, ValueError, OSError):
356+
pass
357+
return None, None
359358

360359
def checkdep_tex():
361360
try:

0 commit comments

Comments
 (0)