Skip to content

Commit

Permalink
remove redundant rstrip calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Anas Husseini committed Jan 24, 2024
1 parent 6bea7cf commit 920be5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion craft_archives/repo/apt_sources_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _install_sources_apt(
formats=cast(Optional[List[str]], package_repo.formats),
name=name,
suites=suites,
url=str(package_repo.url).rstrip("/"),
url=str(package_repo.url),
keyring_path=keyring_path,
)

Expand Down
4 changes: 2 additions & 2 deletions craft_archives/repo/package_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class PackageRepositoryApt(PackageRepository):
@property
def name(self) -> str:
"""Get the repository name."""
return re.sub(r"\W+", "_", str(self.url).rstrip("/"))
return re.sub(r"\W+", "_", str(self.url))

@field_validator("url")
@classmethod
Expand Down Expand Up @@ -323,7 +323,7 @@ def unmarshal(cls, data: Mapping[str, Any]) -> "PackageRepositoryApt":
@property
def pin(self) -> str:
"""The pin string for this repository if needed."""
domain = urlparse(str(self.url).rstrip("/")).netloc
domain = urlparse(str(self.url)).netloc
return f'origin "{domain}"'


Expand Down

0 comments on commit 920be5f

Please sign in to comment.