diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-29 21:16:55 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-29 21:46:55 +0300 |
commit | 201f61f7226c764769f1b0be4e5d1918d38ff1f2 (patch) | |
tree | 5dec8627236dcc263b747fda5a9ef0b45d6d67f4 /sphinx/domains/python.py | |
parent | 2809b30c17a8fe362910f40b91fa2c17012d3ef1 (diff) |
Fix #9280: py domain: "exceptions" module is not displayed
Since v0.2, python domain gives a special treatment for the exceptions
module to suppress its name on documenting exception classes. It had
been worthy on python2 era. But the module has been removed since
python3. Therefore, the special treatment becomes harmful for user
libraries. This removes it to render module names correctly.
Note: Now we've only supported python3. So this is not incompatible.
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r-- | sphinx/domains/python.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index 5035ce2ab..7fb56c635 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -448,12 +448,9 @@ class PyObject(ObjectDescription[Tuple[str, str]]): if prefix: signode += addnodes.desc_addname(prefix, prefix) - elif add_module and self.env.config.add_module_names: - if modname and modname != 'exceptions': - # exceptions are a special case, since they are documented in the - # 'exceptions' module. - nodetext = modname + '.' - signode += addnodes.desc_addname(nodetext, nodetext) + elif modname and add_module and self.env.config.add_module_names: + nodetext = modname + '.' + signode += addnodes.desc_addname(nodetext, nodetext) signode += addnodes.desc_name(name, name) if arglist: |