Skip to content

Commit

Permalink
Use removeprefix/removesuffix instead of incorrect lstrip/rstrip calls (
Browse files Browse the repository at this point in the history
  • Loading branch information
correctmost authored Jan 12, 2025
1 parent 6681501 commit 4212357
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ def _service_started(self, service_name: str) -> str | None:
last_execution_time = SysCommand(
f"systemctl show --property=ActiveEnterTimestamp --no-pager {service_name}",
environment_vars={'SYSTEMD_COLORS': '0'}
).decode().lstrip('ActiveEnterTimestamp=')
).decode().removeprefix('ActiveEnterTimestamp=')

if not last_execution_time:
return None
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/models/mirrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _parse_locale_mirrors(self, mirrorlist: str) -> dict[str, list[MirrorStatusE

url = line.removeprefix('Server = ')
mirror_entry = MirrorStatusEntryV3(
url=url.rstrip('$repo/os/$arch'),
url=url.removesuffix('$repo/os/$arch'),
protocol=urllib.parse.urlparse(url).scheme,
active=True,
country=current_region or 'Worldwide',
Expand Down

0 comments on commit 4212357

Please sign in to comment.