Skip to content

Commit 340a806

Browse files
committed
Update path.py
`.resolve()` here is unnecessary, and can take a long time if the input string is too long. `exists()` already resolves if needed.
1 parent 4a9c814 commit 340a806

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/src/fileex/path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def is_path(path: Any) -> bool:
1818
if not isinstance(path, str):
1919
return False
2020
try:
21-
return Path(path).resolve().exists()
21+
return Path(path).exists()
2222
except OSError:
2323
# If the path cannot be resolved, it is not a valid path (e.g., too long)
2424
return False

0 commit comments

Comments
 (0)