Expand user path in path_exists

This commit is contained in:
Mathieu Comandon 2023-10-18 14:06:55 -07:00
parent a9f0dfabbf
commit 7b17a9a25d

View file

@ -457,6 +457,8 @@ def path_exists(path, check_symlinks=False, exclude_empty=False):
"""
if not path:
return False
if path.startswith("~"):
path = os.path.expanduser(path)
if os.path.exists(path):
if exclude_empty:
return os.stat(path).st_size > 0