Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9aab0be

Browse files
author
Peter Würtz
committed
Merge pull request #1171 from pwuertz/pgf-backend
backend_pgf: handle OSError when testing for xelatex/pdflatex
2 parents 236ee03 + 034b5d5 commit 9aab0be

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/matplotlib/tests/test_backend_pgf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ def check_for(texsystem):
2222
\makeatletter
2323
\@@end
2424
"""
25-
latex = subprocess.Popen(["xelatex", "-halt-on-error"],
26-
stdin=subprocess.PIPE,
27-
stdout=subprocess.PIPE)
28-
stdout, stderr = latex.communicate(header.encode("utf8"))
25+
try:
26+
latex = subprocess.Popen(["xelatex", "-halt-on-error"],
27+
stdin=subprocess.PIPE,
28+
stdout=subprocess.PIPE)
29+
stdout, stderr = latex.communicate(header.encode("utf8"))
30+
except OSError:
31+
return False
2932

3033
return latex.returncode == 0
3134

0 commit comments

Comments
 (0)