unparser: Don't put unnecessary parentheses on class declarations

Backport of
* 25160cdc47
This commit is contained in:
Todd Gamblin 2021-12-23 08:26:55 -08:00 committed by Greg Becker
parent ff5e73d6eb
commit 0776c3b4d6

View file

@ -415,7 +415,7 @@ def _ClassDef(self, t):
self.dispatch(deco)
self.fill("class " + t.name)
if six.PY3:
with self.delimit("(", ")"):
with self.delimit_if("(", ")", condition=t.bases or t.keywords):
comma = False
for e in t.bases:
if comma: