Skip to content

Commit

Permalink
Merge pull request #5976 from jenshnielsen/locklatex
Browse files Browse the repository at this point in the history
Lock calls to latex in texmanager
  • Loading branch information
tacaswell committed Feb 8, 2016
2 parents 424556b + d1e6937 commit cfd95e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/matplotlib/texmanager.py
Expand Up @@ -53,7 +53,7 @@
import matplotlib as mpl
from matplotlib import rcParams
from matplotlib._png import read_png
from matplotlib.cbook import mkdirs
from matplotlib.cbook import mkdirs, Locked
from matplotlib.compat.subprocess import Popen, PIPE, STDOUT
import matplotlib.dviread as dviread
import re
Expand Down Expand Up @@ -403,7 +403,8 @@ def make_dvi(self, tex, fontsize):
'latex -interaction=nonstopmode %s > "%s"' %
(os.path.split(texfile)[-1], outfile))
mpl.verbose.report(command, 'debug')
exit_status = os.system(command)
with Locked(self.texcache):
exit_status = os.system(command)
try:
with open(outfile) as fh:
report = fh.read()
Expand Down

0 comments on commit cfd95e0

Please sign in to comment.