Skip to content

Commit 651c48d

Browse files
committed
Use wrap_with_in_parens consistently #45
Reported-by: Steven Esser <[email protected]> Signed-off-by: Philippe Ombredanne <[email protected]>
1 parent 3e4e26b commit 651c48d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/license_expression/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@ def render_as_readable(self, template='{symbol.key}', *args, **kwargs):
836836
"""
837837
if isinstance(self, LicenseWithExceptionSymbol):
838838
return self.render(
839-
template=template, wrap_in_parens=False, *args, **kwargs)
839+
template=template, wrap_with_in_parens=False, *args, **kwargs)
840840
else:
841841
return self.render(template=template, wrap_with_in_parens=True, *args, **kwargs)
842842

@@ -1090,7 +1090,9 @@ def decompose(self):
10901090

10911091
def render(self, template='{symbol.key}', wrap_with_in_parens=False, *args, **kwargs):
10921092
"""
1093-
Return a formatted WITH expression. If `wrap_in_parens`, wrap in parens.
1093+
Return a formatted WITH expression. If `wrap_with_in_parens`, wrap in
1094+
parens a WITH expression, unless it is alone and not used with other AND
1095+
or OR sub-expressions.
10941096
"""
10951097
lic = self.license_symbol.render(template, *args, **kwargs)
10961098
exc = self.exception_symbol.render(template, *args, **kwargs)

0 commit comments

Comments
 (0)