From d1e6937db41d8979d6fef256f027718ed0ce7149 Mon Sep 17 00:00:00 2001 From: Jens Hedegaard Nielsen Date: Mon, 8 Feb 2016 16:21:00 +0000 Subject: [PATCH] Lock calls to latex These seem to be one of the reasons for random failures in the test suite when running in parallel --- lib/matplotlib/texmanager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/texmanager.py b/lib/matplotlib/texmanager.py index 760a693ffba..c1a2010c957 100644 --- a/lib/matplotlib/texmanager.py +++ b/lib/matplotlib/texmanager.py @@ -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 @@ -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()