Skip to content

Commit 9bd1477

Browse files
committed
Raise error on expressions with no operator
1 parent 790e456 commit 9bd1477

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

flit_core/flit_core/config.py

+3
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,9 @@ def normalise_compound_license_expr(s: str) -> str:
868868
raise ConfigError(invalid_msg.format(s=s, reason=reason))
869869
parts.append(part)
870870
else:
871+
if parts and parts[-1] not in {' AND ', ' OR ', '('}:
872+
reason = "a license ID must follow a license expression operator or '('"
873+
raise ConfigError(invalid_msg.format(s=s, reason=reason))
871874
simple_expr = normalise_simple_license_expr(part)
872875
parts.append(simple_expr)
873876

0 commit comments

Comments
 (0)