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

Skip to content

Commit 6b57189

Browse files
author
pwuertz
committed
backend_pgf: fix error in exception handling
1 parent f38046b commit 6b57189

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/backend_pgf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,8 @@ def print_pdf(self, filename, *args, **kwargs):
711711
cmdargs = [texcommand, "-interaction=nonstopmode", "-halt-on-error", "figure.tex"]
712712
try:
713713
stdout = subprocess.check_output(cmdargs, stderr=subprocess.STDOUT)
714-
except:
715-
raise RuntimeError("%s was not able to process your file.\n\nFull log:\n%s" % (texcommand, stdout))
714+
except subprocess.CalledProcessError as e:
715+
raise RuntimeError("%s was not able to process your file.\n\nFull log:\n%s" % (texcommand, e.output))
716716
shutil.copyfile("figure.pdf", target)
717717
finally:
718718
os.chdir(cwd)

0 commit comments

Comments
 (0)