8000 backend_pgf: handle OSError when testing for xelatex/pdflatex · matplotlib/matplotlib@034b5d5 · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit 034b5d5

Browse files
author
pwuertz
committed
backend_pgf: handle OSError when testing for xelatex/pdflatex
1 parent 236ee03 commit 034b5d5

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