diff options
author | Seth Morton <seth.m.morton@gmail.com> | 2023-02-26 20:20:38 -0800 |
---|---|---|
committer | Seth Morton <seth.m.morton@gmail.com> | 2023-02-26 20:20:38 -0800 |
commit | 0949779e4e0d78b65b508a8cc2f37439e4663faf (patch) | |
tree | 911dca5838e1ebf79b2e383fa988851a24d031fa | |
parent | 653f76e940f63e0b45ffa48410f5c34359386b99 (diff) | |
parent | 34078b7fd600ca655ac10f6502eb5b430670b414 (diff) | |
download | natsort-0949779e4e0d78b65b508a8cc2f37439e4663faf.tar.gz |
Merge branch 'master' of github.com:SethMMorton/natsort
-rw-r--r-- | natsort/natsort.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/natsort/natsort.py b/natsort/natsort.py index 2038f3e..3904ec5 100644 --- a/natsort/natsort.py +++ b/natsort/natsort.py @@ -9,6 +9,7 @@ The majority of the "work" is defined in utils.py. import platform from functools import partial from operator import itemgetter +from pathlib import PurePath from typing import ( Any, Callable, @@ -669,7 +670,9 @@ def _split_apply( ) -> Iterator[str]: if key is not None: v = key(v) - return utils.path_splitter(str(v)) + if not isinstance(v, (str, PurePath)): + v = str(v) + return utils.path_splitter(v) # Choose the implementation based on the host OS |