Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/licensedcode/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ def __init__(
or junk-only lines.
Line numbers start at ``start_line`` which is 1-based by default.
"""
assert (location or query_string) and idx
if not ((location or query_string) and idx):
raise ValueError(
"Either location or query_string must be provided, and idx must be set"
)


self.location = location
self.query_string = query_string
Expand Down
6 changes: 5 additions & 1 deletion src/packagedcode/maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,11 @@ def __init__(self, location=None, text=None):
"""
Build a POM from a location or unicode text.
"""
assert (location or text) and (not (location and text))
if not ((location or text) and not (location and text)):
raise ValueError(
"Either location or text must be provided, but not both"
)


if location:
try:
Expand Down
Loading