Skip to content

Commit 9b8e4a5

Browse files
author
longendu
committed
fix pathlib issue; bump up version
1 parent efb171e commit 9b8e4a5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

aiutil/filesystem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def filter(
694694
return _filter_num(path, pattern=pattern, num_lines=num_lines)
695695

696696

697-
def trace_dir_upwards(path: str | pathlib.Path, name: str) -> PosixPathPair:
697+
def trace_dir_upwards(path: str | Path, name: str) -> PosixPathPair:
698698
"""Find the parent directory with the specified name.
699699
700700
Args:
@@ -705,15 +705,15 @@ def trace_dir_upwards(path: str | pathlib.Path, name: str) -> PosixPathPair:
705705
A PosixPathPair which contains the parent directory
706706
and the relative path to this parent directory.
707707
"""
708-
def _trace_dir_upwards(path: pathlib.Path) -> pathlib.Path:
708+
def _trace_dir_upwards(path: Path) -> Path:
709709
while (stem := path.stem) != name:
710710
if not stem:
711711
raise ValueError(f"The path {path} does not contain /{name}/!")
712712
path = path.parent
713713
return path
714714

715715
if isinstance(path, str):
716-
path = pathlib.Path(path)
716+
path = Path(path)
717717
prefix = _trace_dir_upwards(path)
718718
return PosixPathPair(prefix, path.relative_to(prefix))
719719

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)