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

Skip to content

Commit d1e6937

Browse files
committed
Lock calls to latex
These seem to be one of the reasons for random failures in the test suite when running in parallel
1 parent 424556b commit d1e6937

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/texmanager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
import matplotlib as mpl
5454
from matplotlib import rcParams
5555
from matplotlib._png import read_png
56-
from matplotlib.cbook import mkdirs
56+
from matplotlib.cbook import mkdirs, Locked
5757
from matplotlib.compat.subprocess import Popen, PIPE, STDOUT
5858
import matplotlib.dviread as dviread
5959
import re
@@ -403,7 +403,8 @@ def make_dvi(self, tex, fontsize):
403403
'latex -interaction=nonstopmode %s > "%s"' %
404404
(os.path.split(texfile)[-1], outfile))
405405
mpl.verbose.report(command, 'debug')
406-
exit_status = os.system(command)
406+
with Locked(self.texcache):
407+
exit_status = os.system(command)
407408
try:
408409
with open(outfile) as fh:
409410
report = fh.read()

0 commit comments

Comments
 (0)