mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Make fallback for changed get_signature_prefix()
Fixes sphinx-doc/sphinx#9832
This commit is contained in:
@@ -495,6 +495,12 @@ class PyObject(ObjectDescription[Tuple[str, str]]):
|
||||
|
||||
sig_prefix = self.get_signature_prefix(sig)
|
||||
if sig_prefix:
|
||||
if type(sig_prefix) is str:
|
||||
logger.warning("Python directive get_signature_prefix() returns a str ('{}')"
|
||||
" instead of a list of nodes (changed in 4.3).".format(sig_prefix),
|
||||
location=signode)
|
||||
signode += addnodes.desc_annotation(sig_prefix, '', nodes.Text(sig_prefix, sig_prefix))
|
||||
else:
|
||||
signode += addnodes.desc_annotation(str(sig_prefix), '', *sig_prefix)
|
||||
|
||||
if prefix:
|
||||
|
||||
Reference in New Issue
Block a user