Skip to content

Commit

Permalink
Remove usage of str.removesuffix()
Browse files Browse the repository at this point in the history
The removesuffix attribute is only available from Python 3.9+

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
  • Loading branch information
AyanSinhaMahapatra committed Jul 1, 2024
1 parent bc49ca0 commit 56aa35d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/packagedcode/swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def get_dependencies(dependencies):
def get_namespace_and_name(url):
parsed_url = parse.urlparse(url)
hostname = parsed_url.hostname
path = parsed_url.path.removesuffix(".git")
path = parsed_url.path.replace(".git", "")
canonical_name = hostname + path

return canonical_name.rsplit("/", 1)
Expand Down

0 comments on commit 56aa35d

Please sign in to comment.