diff options
author | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2022-06-14 18:29:18 +0100 |
---|---|---|
committer | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2022-06-14 18:29:18 +0100 |
commit | eae646504fdbecb6d06b0d5f401fedc84975b720 (patch) | |
tree | b7dfa1f5b920929a8263a7350ace47c5734eef32 /sphinx/pycode/ast.py | |
parent | 0768f22aa1a007522c8d6a65b3b3b174ddeab3c1 (diff) | |
download | sphinx-git-eae646504fdbecb6d06b0d5f401fedc84975b720.tar.gz |
Switch check
Diffstat (limited to 'sphinx/pycode/ast.py')
-rw-r--r-- | sphinx/pycode/ast.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py index ac094494c..7d0389cee 100644 --- a/sphinx/pycode/ast.py +++ b/sphinx/pycode/ast.py @@ -203,9 +203,9 @@ class _UnparseVisitor(ast.NodeVisitor): def visit_UnaryOp(self, node: ast.UnaryOp) -> str: # UnaryOp is one of {UAdd, USub, Invert, Not}. Only Not needs a space. - if not isinstance(node.op, ast.Not): - return "%s%s" % (self.visit(node.op), self.visit(node.operand)) - return "%s %s" % (self.visit(node.op), self.visit(node.operand)) + if isinstance(node.op, ast.Not): + return "%s %s" % (self.visit(node.op), self.visit(node.operand)) + return "%s%s" % (self.visit(node.op), self.visit(node.operand)) def visit_Tuple(self, node: ast.Tuple) -> str: if len(node.elts) == 0: |