Skip to content

Commit f5602fa

Browse files
committed
added message to invariant assertions
1 parent ff9e15d commit f5602fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pip/_internal/req/constructors.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def _set_requirement_extras(req: Requirement, new_extras: Set[str]) -> Requireme
7171
flags=re.ASCII,
7272
)
7373
# ireq.req is a valid requirement so the regex should always match
74-
assert match is not None
74+
assert match is not None, f"regex match on requirement {req} failed, this should never happen"
7575
pre: Optional[str] = match.group(1)
7676
post: Optional[str] = match.group(3)
77-
assert pre is not None and post is not None
77+
assert pre is not None and post is not None, f"regex group selection for requirement {req} failed, this should never happen"
7878
extras: str = "[%s]" % ",".join(sorted(new_extras)) if new_extras else ""
7979
return Requirement(f"{pre}{extras}{post}")
8080

0 commit comments

Comments
 (0)