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 0fc4ad6

Browse filesBrowse files
author
Joshua Taillon
committed
Change _get_executable_info() to catch ExecutableNotFoundError
1 parent 3b65d42 commit 0fc4ad6
Copy full SHA for 0fc4ad6

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,12 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
331331
raise ExecutableNotFoundError(message)
332332
elif name == "inkscape":
333333
try:
334-
# use "without-gui" option (only works with inkscape version < 1.0):
335-
info = impl(["inkscape", "--without-gui", "-V"], "Inkscape ([^ ]*)")
336-
except subprocess.CalledProcessError as _cpe:
337-
# for inkscape v > 1.0, --without-gui is not needed:
334+
# use headless option first (works with inkscape version < 1.0):
335+
info = impl(["inkscape", "--without-gui", "-V"],
336+
"Inkscape ([^ ]*)")
337+
except ExecutableNotFoundError as _e:
338+
# if --without-gui is not accepted, we're using Inkscape v > 1.0
339+
# so try without the headless option:
338340
info = impl(["inkscape", "-V"], "Inkscape ([^ ]*)")
339341
if info and info.version >= "1.0":
340342
raise ExecutableNotFoundError(

0 commit comments

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