mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix translator class check in `SigElementFallbackTransform` (#11283)
This commit is contained in:
@@ -237,7 +237,11 @@ class SigElementFallbackTransform(SphinxPostTransform):
|
|||||||
return hasattr(translator, "visit_%s" % node.__name__)
|
return hasattr(translator, "visit_%s" % node.__name__)
|
||||||
|
|
||||||
translator = self.app.builder.get_translator_class()
|
translator = self.app.builder.get_translator_class()
|
||||||
if isinstance(translator, SphinxTranslator):
|
if translator is None:
|
||||||
|
# do nothing if no translator class is specified (e.g., on a dummy builder)
|
||||||
|
return
|
||||||
|
|
||||||
|
if issubclass(translator, SphinxTranslator):
|
||||||
# subclass of SphinxTranslator supports desc_sig_element nodes automatically.
|
# subclass of SphinxTranslator supports desc_sig_element nodes automatically.
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user