From efce69a23e9bacf4c69956dba0fd37af8565d5c1 2012-08-21 18:27:32 From: Jörgen Stenarson Date: 2012-08-21 18:27:32 Subject: [PATCH] Fix for latextools commandline arguments There was a spelling error in the -halt-on-error commandline arg. We also send stdout/stderr to devnull. --- diff --git a/IPython/lib/latextools.py b/IPython/lib/latextools.py index 89c22a2..d8860e3 100644 --- a/IPython/lib/latextools.py +++ b/IPython/lib/latextools.py @@ -132,14 +132,15 @@ def latex_to_png_dvipng(s, wrap): with open(tmpfile, "w") as f: f.writelines(genelatex(s, wrap)) - subprocess.check_call( - ["latex", "-halt-on-errror", tmpfile], cwd=workdir, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - subprocess.check_call( - ["dvipng", "-T", "tight", "-x", "1500", "-z", "9", - "-bg", "transparent", "-o", outfile, dvifile], cwd=workdir, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + with open(os.devnull, 'w') as devnull: + subprocess.check_call( + ["latex", "-halt-on-error", tmpfile], cwd=workdir, + stdout=devnull, stderr=devnull) + + subprocess.check_call( + ["dvipng", "-T", "tight", "-x", "1500", "-z", "9", + "-bg", "transparent", "-o", outfile, dvifile], cwd=workdir, + stdout=devnull, stderr=devnull) with open(outfile, "rb") as f: bin_data = f.read()