Skip to content

Commit 4659fc2

Browse files
authored
Fix translator class check in SigElementFallbackTransform (#11283)
1 parent 063c2e3 commit 4659fc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sphinx/transforms/post_transforms/__init__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ def has_visitor(translator: type[nodes.NodeVisitor], node: type[Element]) -> boo
237237
return hasattr(translator, "visit_%s" % node.__name__)
238238

239239
translator = self.app.builder.get_translator_class()
240-
if isinstance(translator, SphinxTranslator):
240+
if translator is None:
241+
# do nothing if no translator class is specified (e.g., on a dummy builder)
242+
return
243+
244+
if issubclass(translator, SphinxTranslator):
241245
# subclass of SphinxTranslator supports desc_sig_element nodes automatically.
242246
return
243247

0 commit comments

Comments
 (0)