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 a117e19

Browse filesBrowse files
committed
texmanager: Ignore dvipng if it cannot be found, instead of raising OSError.
1 parent b29c93c commit a117e19
Copy full SHA for a117e19

File tree

Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-3
lines changed

‎lib/matplotlib/texmanager.py

Copy file name to clipboardExpand all lines: lib/matplotlib/texmanager.py
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@
6363

6464

6565
def dvipng_hack_alpha():
66-
p = Popen('dvipng -version', shell=True, stdin=PIPE, stdout=PIPE,
67-
stderr=STDOUT, close_fds=(sys.platform != 'win32'))
66+
try:
67+
p = Popen('dvipng -version', stdin=PIPE, stdout=PIPE, stderr=STDOUT,
68+
close_fds=(sys.platform != 'win32'))
69+
except OSError:
70+
mpl.verbose.report('No dvipng was found', 'helpful')
71+
return False
6872
stdin, stdout = p.stdin, p.stdout
6973
for line in stdout:
7074
if line.startswith(b'dvipng '):
@@ -74,7 +78,7 @@ def dvipng_hack_alpha():
7478
version = version.decode('ascii')
7579
version = distutils.version.LooseVersion(version)
7680
return version < distutils.version.LooseVersion('1.6')
77-
mpl.verbose.report('No dvipng was found', 'helpful')
81+
mpl.verbose.report('Unexpected response from dvipng -version', 'helpful')
7882
return False
7983

8084

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.