Skip to content

Commit 3467b4c

Browse files
committed
Simplify dirname logic for URLs
1 parent b5a0fbd commit 3467b4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pystac/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _make_relative_href_url(
7474

7575
# If the start path is not a directory, get the parent directory
7676
start_dir = (
77-
parsed_start.path if start_is_dir else parsed_start.path.rsplit("/", 1)[0]
77+
parsed_start.path if start_is_dir else _pathlib.dirname(parsed_start.path)
7878
)
7979

8080
# Strip the leading slashes from both paths

0 commit comments

Comments
 (0)