Browse files

backend_pgf: fix error in exception handling

  • Loading branch information...
1 parent f38046b commit 6b571899eac97a9b9da4cdf4b90cf9901a7f098a pwuertz committed Aug 21, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/matplotlib/backends/backend_pgf.py
View
4 lib/matplotlib/backends/backend_pgf.py
@@ -711,8 +711,8 @@ def print_pdf(self, filename, *args, **kwargs):
cmdargs = [texcommand, "-interaction=nonstopmode", "-halt-on-error", "figure.tex"]
try:
stdout = subprocess.check_output(cmdargs, stderr=subprocess.STDOUT)
- except:
- raise RuntimeError("%s was not able to process your file.\n\nFull log:\n%s" % (texcommand, stdout))
+ except subprocess.CalledProcessError as e:
+ raise RuntimeError("%s was not able to process your file.\n\nFull log:\n%s" % (texcommand, e.output))
shutil.copyfile("figure.pdf", target)
finally:
os.chdir(cwd)

0 comments on commit 6b57189

Please sign in to comment.