File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 30
30
from sphinx .util .template import LaTeXRenderer
31
31
32
32
if TYPE_CHECKING :
33
+ from typing import Any
34
+
33
35
from docutils .nodes import Element
34
36
35
37
from sphinx .application import Sphinx
@@ -268,14 +270,13 @@ def render_math(
268
270
generated_path = self .builder .outdir / self .builder .imagedir / 'math' / filename
269
271
generated_path .parent .mkdir (parents = True , exist_ok = True )
270
272
273
+ lock : Any = contextlib .nullcontext ()
271
274
if self .builder .parallel_ok :
272
275
# ensure parallel workers do not try to write the image depth
273
276
# multiple times to achieve reproducible builds
274
277
tempdir = ensure_tempdir (self .builder )
275
278
# on unix lock files are not disposed automatically so create it in the temp dir
276
279
lock = filelock .FileLock (tempdir / (generated_path .stem + '.lock' ))
277
- else :
278
- lock = contextlib .nullcontext ()
279
280
280
281
with lock :
281
282
if not generated_path .is_file ():
You can’t perform that action at this time.
0 commit comments