8000 backend_pgf: Error message for missing latex executable (fix #3051) · matplotlib/matplotlib@9822628 · GitHub
[go: up one dir, main page]

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 9822628

Browse files
committed
backend_pgf: Error message for missing latex executable (fix #3051)
1 parent 3ec5704 commit 9822628

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,13 @@ def __init__(self):
309309
self.texcommand = get_texcommand()
310310
self.latex_header = LatexManager._build_latex_header()
311311
latex_end = "\n\\makeatletter\n\\@@end\n"
312-
latex = subprocess.Popen([self.texcommand, "-halt-on-error"],
313-
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
314-
cwd=self.tmpdir)
312+
try:
313+
latex = subprocess.Popen([self.texcommand, "-halt-on-error"],
314+
stdin=subprocess.PIPE,
315+
stdout=subprocess.PIPE,
316+
cwd=self.tmpdir)
317+
except OSError:
318+
raise RuntimeError("Error starting process '%s'" % self.texcommand)
315319
test_input = self.latex_header + latex_end
316320
stdout, stderr = latex.communicate(test_input.encode("utf-8"))
317321
if latex.returncode != 0:

0 commit comments

Comments
 (0)
0