Skip to content

Commit

Permalink
dvc_fs: ignore NotADirectoryError in ls
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum committed Jul 19, 2023
1 parent ea5f7d4 commit 5b5093b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dvc/fs/dvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def ls( # pylint: disable=arguments-differ # noqa: C901
dvc_infos = {}
if dvc_fs:
dvc_path = _get_dvc_path(dvc_fs, subkey)
with suppress(FileNotFoundError):
with suppress(FileNotFoundError, NotADirectoryError):
for info in dvc_fs.ls(dvc_path, detail=True):
dvc_infos[dvc_fs.path.name(info["name"])] = info
dvc_exists = bool(dvc_infos) or dvc_fs.exists(dvc_path)
Expand Down

0 comments on commit 5b5093b

Please sign in to comment.