mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #10075 from danieleades/refactor/merge-isinstance-calls
merge 'isinstance' calls (SIM101)
This commit is contained in:
commit
72d352f64e
@ -316,8 +316,7 @@ class DocFieldTransformer:
|
||||
if is_typefield:
|
||||
# filter out only inline nodes; others will result in invalid
|
||||
# markup being written out
|
||||
content = [n for n in content if isinstance(n, nodes.Inline) or
|
||||
isinstance(n, nodes.Text)]
|
||||
content = [n for n in content if isinstance(n, (nodes.Inline, nodes.Text))]
|
||||
if content:
|
||||
types.setdefault(typename, {})[fieldarg] = content
|
||||
continue
|
||||
|
@ -1857,8 +1857,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
done = 0
|
||||
if len(node.children) == 1:
|
||||
child = node.children[0]
|
||||
if isinstance(child, nodes.bullet_list) or \
|
||||
isinstance(child, nodes.enumerated_list):
|
||||
if isinstance(child, (nodes.bullet_list, nodes.enumerated_list)):
|
||||
done = 1
|
||||
if not done:
|
||||
self.body.append(r'\begin{quote}' + CR)
|
||||
@ -1869,8 +1868,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
done = 0
|
||||
if len(node.children) == 1:
|
||||
child = node.children[0]
|
||||
if isinstance(child, nodes.bullet_list) or \
|
||||
isinstance(child, nodes.enumerated_list):
|
||||
if isinstance(child, (nodes.bullet_list, nodes.enumerated_list)):
|
||||
done = 1
|
||||
if not done:
|
||||
self.body.append(r'\end{quote}' + CR)
|
||||
|
Loading…
Reference in New Issue
Block a user