lib.FileContext.is_dir(): Add follow_symlinks

Make FileContext.is_dir() usable: - Add follow_symlinks parameter meant to do the obvious - Fix missing await

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-27 07:31:23 +02:00
commit 6cfb86d2a7
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
2 changed files with 8 additions and 5 deletions

View file

@ -172,5 +172,7 @@ class Local(Base):
async def _chmod(self, path: str, mode: int) -> None:
os.chmod(path, mode)
async def _is_dir(self, path: str) -> bool:
async def _is_dir(self, path: str, follow_symlinks: bool) -> bool:
if (not follow_symlinks) and os.islink(path):
return False
return os.path.isdir(path)