summaryrefslogtreecommitdiffstats
path: root/Lib/ast.py
diff options
context:
space:
mode:
authorBatuhan Taskaya <batuhanosmantaskaya@gmail.com>2020-05-16 21:53:25 (GMT)
committerGitHub <noreply@github.com>2020-05-16 21:53:25 (GMT)
commit25160cdc4775a1ddb4e37c8bf5a6e31ad9c146ed (patch)
tree5a119888dfcc85339ce279d352a05def90865431 /Lib/ast.py
parentce4a753dcb3eef3d68e892a6515490b1aa219651 (diff)
downloadcpython-25160cdc4775a1ddb4e37c8bf5a6e31ad9c146ed.zip
cpython-25160cdc4775a1ddb4e37c8bf5a6e31ad9c146ed.tar.gz
cpython-25160cdc4775a1ddb4e37c8bf5a6e31ad9c146ed.tar.bz2
bpo-38870: Don't put unnecessary parentheses on class declarations in ast.parse (GH-20134)
Diffstat (limited to 'Lib/ast.py')
-rw-r--r--Lib/ast.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/ast.py b/Lib/ast.py
index 1de37b9..d6cb334 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -930,7 +930,7 @@ class _Unparser(NodeVisitor):
self.fill("@")
self.traverse(deco)
self.fill("class " + node.name)
- with self.delimit("(", ")"):
+ with self.delimit_if("(", ")", condition = node.bases or node.keywords):
comma = False
for e in node.bases:
if comma: