diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-22 18:47:30 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-12-22 18:47:30 +0900 |
commit | 5640cf879f91c8ca5e71b68ab5a5fd24b536703a (patch) | |
tree | 6fc2107d8adc1ade4f9a8ca260db4e156fdde609 /sphinx/domains/python.py | |
parent | e83bb29789a093c651a255a509430a03346a5afb (diff) | |
parent | 43c089fd28dfdc33cc67b364724db51d3f5c1804 (diff) | |
download | sphinx-git-5640cf879f91c8ca5e71b68ab5a5fd24b536703a.tar.gz |
Merge branch '2.0'
Diffstat (limited to 'sphinx/domains/python.py')
-rw-r--r-- | sphinx/domains/python.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index 653dbf562..3e11173dc 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -306,7 +306,7 @@ class PyObject(ObjectDescription): def add_target_and_index(self, name_cls: Tuple[str, str], sig: str, signode: desc_signature) -> None: modname = self.options.get('module', self.env.ref_context.get('py:module')) - fullname = (modname and modname + '.' or '') + name_cls[0] + fullname = (modname + '.' if modname else '') + name_cls[0] # note target if fullname not in self.state.document.ids: signode['names'].append(fullname) @@ -821,7 +821,7 @@ class PythonModuleIndex(Index): num_toplevels += 1 subtype = 0 - qualifier = deprecated and _('Deprecated') or '' + qualifier = _('Deprecated') if deprecated else '' entries.append(IndexEntry(stripped + modname, subtype, docname, 'module-' + stripped + modname, platforms, qualifier, synopsis)) @@ -999,7 +999,7 @@ class PythonDomain(Domain): ) -> Element: modname = node.get('py:module') clsname = node.get('py:class') - searchmode = node.hasattr('refspecific') and 1 or 0 + searchmode = 1 if node.hasattr('refspecific') else 0 matches = self.find_obj(env, modname, clsname, target, type, searchmode) if not matches: |