Skip to content

Commit

Permalink
Remove extraneous quotes in f-strings by using !r (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewdurbin authored Nov 6, 2024
1 parent 4dc334c commit 9c66f5c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/packaging/specifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def __init__(self, spec: str = "", prereleases: bool | None = None) -> None:
"""
match = self._regex.search(spec)
if not match:
raise InvalidSpecifier(f"Invalid specifier: '{spec}'")
raise InvalidSpecifier(f"Invalid specifier: {spec!r}")

self._spec: tuple[str, str] = (
match.group("operator").strip(),
Expand Down
2 changes: 1 addition & 1 deletion src/packaging/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def parse_wheel_filename(
build_match = _build_tag_regex.match(build_part)
if build_match is None:
raise InvalidWheelFilename(
f"Invalid build number: {build_part} in '{filename!r}'"
f"Invalid build number: {build_part} in {filename!r}"
)
build = cast(BuildTag, (int(build_match.group(1)), build_match.group(2)))
else:
Expand Down
2 changes: 1 addition & 1 deletion src/packaging/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __init__(self, version: str) -> None:
# Validate the version and parse it into pieces
match = self._regex.search(version)
if not match:
raise InvalidVersion(f"Invalid version: '{version}'")
raise InvalidVersion(f"Invalid version: {version!r}")

# Store the parsed out pieces of the version
self._version = _Version(
Expand Down

0 comments on commit 9c66f5c

Please sign in to comment.