diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-13 23:36:49 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-04-13 23:36:49 +0900 |
commit | 1aca70cf8095dd87f943fe69bee97befd9be9f55 (patch) | |
tree | 7bf402c7f58c67705ae58074ebcbda7878d17acf /sphinx/pycode | |
parent | b08a00af739ffbf5e957c0649ac4c4c8d4f866ed (diff) | |
parent | b2a601a33dfb96c2a2257e0f9307a73377351650 (diff) | |
download | sphinx-git-1aca70cf8095dd87f943fe69bee97befd9be9f55.tar.gz |
Merge branch '3.x'
Diffstat (limited to 'sphinx/pycode')
-rw-r--r-- | sphinx/pycode/ast.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py index 4d8aa8955..fb2a7152d 100644 --- a/sphinx/pycode/ast.py +++ b/sphinx/pycode/ast.py @@ -114,7 +114,10 @@ def unparse(node: ast.AST) -> str: elif isinstance(node, ast.UnaryOp): return "%s %s" % (unparse(node.op), unparse(node.operand)) elif isinstance(node, ast.Tuple): - return ", ".join(unparse(e) for e in node.elts) + if node.elts: + return ", ".join(unparse(e) for e in node.elts) + else: + return "()" elif sys.version_info > (3, 6) and isinstance(node, ast.Constant): # this branch should be placed at last return repr(node.value) |