##// END OF EJS Templates
Replace usage of os.devnull with subprocess.DEVNULL
Yann Pellegrini -
Show More
@@ -160,12 +160,11 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):"
160 with workdir.joinpath(tmpfile).open("w", encoding="utf8") as f:
160 with workdir.joinpath(tmpfile).open("w", encoding="utf8") as f:
161 f.writelines(genelatex(s, wrap))
161 f.writelines(genelatex(s, wrap))
162
162
163 with open(os.devnull, 'wb') as devnull:
164 subprocess.check_call(
163 subprocess.check_call(
165 ["latex", "-halt-on-error", "-interaction", "batchmode", tmpfile],
164 ["latex", "-halt-on-error", "-interaction", "batchmode", tmpfile],
166 cwd=workdir,
165 cwd=workdir,
167 stdout=devnull,
166 stdout=subprocess.DEVNULL,
168 stderr=devnull,
167 stderr=subprocess.DEVNULL,
169 startupinfo=startupinfo,
168 startupinfo=startupinfo,
170 )
169 )
171
170
@@ -188,8 +187,8 b" def latex_to_png_dvipng(s, wrap, color='Black', scale=1.0):"
188 color,
187 color,
189 ],
188 ],
190 cwd=workdir,
189 cwd=workdir,
191 stdout=devnull,
190 stdout=subprocess.DEVNULL,
192 stderr=devnull,
191 stderr=subprocess.DEVNULL,
193 startupinfo=startupinfo,
192 startupinfo=startupinfo,
194 )
193 )
195
194
General Comments 0
You need to be logged in to leave comments. Login now