Skip to content

Commit c07e6ca

Browse files
committed
don't overwrite an asserted env val
1 parent 55ff8d9 commit c07e6ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sphinx_immaterial/mermaid_diagrams.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ def copy_mermaid_dist(app: Sphinx, env: BuildEnvironment):
8080
def _merge_env_key(
8181
app: Sphinx, env: BuildEnvironment, docnames: List[str], other: BuildEnvironment
8282
) -> None:
83-
setattr(env, _COPY_MERMAID_DIST_ENV_KEY, getattr(other, _COPY_MERMAID_DIST_ENV_KEY))
83+
val = getattr(env, _COPY_MERMAID_DIST_ENV_KEY, False)
84+
setattr(
85+
env,
86+
_COPY_MERMAID_DIST_ENV_KEY,
87+
val or getattr(other, _COPY_MERMAID_DIST_ENV_KEY),
88+
)
8489

8590

8691
def setup(app: Sphinx):

0 commit comments

Comments
 (0)