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:
parent
b5762116a1
commit
6cfb86d2a7
2 changed files with 8 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue