Skip to content

Commit ceb0489

Browse files
committed
FIX: Check for sphinx_exercise_registry in all registered post_tranforms
1 parent 9715a72 commit ceb0489

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sphinx_exercise/post_transforms.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ class ResolveTitlesInSolutions(SphinxPostTransform):
176176

177177
def run(self):
178178

179+
if not hasattr(self.env, "sphinx_exercise_registry"):
180+
return
181+
179182
# Update Solution Directives
180183
for node in self.document.traverse(solution_node):
181184
label = node.get("label")
@@ -207,6 +210,10 @@ class ResolveLinkTextToSolutions(SphinxPostTransform):
207210
default_priority = 22
208211

209212
def run(self):
213+
214+
if not hasattr(self.env, "sphinx_exercise_registry"):
215+
return
216+
210217
# Update Solution References
211218
for node in self.document.traverse(docutil_nodes.reference):
212219
refid = node.get("refid")

0 commit comments

Comments
 (0)