Skip to content

Commit

Permalink
only convert input to str if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobatymo committed Dec 19, 2022
1 parent 837a387 commit 64d88d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion natsort/natsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def _split_apply(
) -> Iterator[str]:
if key is not None:
v = key(v)
return utils.path_splitter(str(v))
return utils.path_splitter(v)


# Choose the implementation based on the host OS
Expand Down
2 changes: 1 addition & 1 deletion natsort/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ def path_splitter(
"""
if not isinstance(s, PurePath):
s = PurePath(s)
s = PurePath(str(s))

# Split the path into parts.
try:
Expand Down

0 comments on commit 64d88d9

Please sign in to comment.