Skip to content

When latex fails, make sure it does not write a dvi. #10348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/matplotlib/texmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ def make_dvi(self, tex, fontsize):
texfile = self.make_tex(tex, fontsize)
with Locked(self.texcache):
self._run_checked_subprocess(
["latex", "-interaction=nonstopmode", texfile], tex)
["latex", "-interaction=nonstopmode", "--halt-on-error",
texfile], tex)
for fname in glob.glob(basefile + '*'):
if not fname.endswith(('dvi', 'tex')):
try:
Expand All @@ -387,7 +388,8 @@ def make_dvi_preview(self, tex, fontsize):
if not os.path.exists(dvifile) or not os.path.exists(baselinefile):
texfile = self.make_tex_preview(tex, fontsize)
report = self._run_checked_subprocess(
["latex", "-interaction=nonstopmode", texfile], tex)
["latex", "-interaction=nonstopmode", "--halt-on-error",
texfile], tex)

# find the box extent information in the latex output
# file and store them in ".baseline" file
Expand Down