Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 95a3bb7

Browse filesBrowse files
committed
BUG: gswin64c.exe not detected on Windows
Move the try/except statement into the loop in order to continue, not break, the loop when an exception occurs.
1 parent cb2e0b8 commit 95a3bb7
Copy full SHA for 95a3bb7

File tree

Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-10
lines changed

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+9-10Lines changed: 9 additions & 10 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.