Skip to content

Commit 72b29dd

Browse files
committed
any
1 parent 5363a57 commit 72b29dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sphinx/ext/imgmath.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from sphinx.util.template import LaTeXRenderer
3131

3232
if TYPE_CHECKING:
33+
from typing import Any
34+
3335
from docutils.nodes import Element
3436

3537
from sphinx.application import Sphinx
@@ -268,14 +270,13 @@ def render_math(
268270
generated_path = self.builder.outdir / self.builder.imagedir / 'math' / filename
269271
generated_path.parent.mkdir(parents=True, exist_ok=True)
270272

273+
lock: Any = contextlib.nullcontext()
271274
if self.builder.parallel_ok:
272275
# ensure parallel workers do not try to write the image depth
273276
# multiple times to achieve reproducible builds
274277
tempdir = ensure_tempdir(self.builder)
275278
# on unix lock files are not disposed automatically so create it in the temp dir
276279
lock = filelock.FileLock(tempdir / (generated_path.stem + '.lock'))
277-
else:
278-
lock = contextlib.nullcontext()
279280

280281
with lock:
281282
if not generated_path.is_file():

0 commit comments

Comments
 (0)