From 75e253984cdaa838ba9d9006a630a24b560f5151 Mon Sep 17 00:00:00 2001 From: yanghua Date: Tue, 20 Aug 2024 20:04:31 +0800 Subject: [PATCH] Address review concerns --- tosfs/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tosfs/core.py b/tosfs/core.py index 9bf5eb2..1f88370 100644 --- a/tosfs/core.py +++ b/tosfs/core.py @@ -239,7 +239,7 @@ def rmdir(self, path: str) -> None: if not self.isdir(path): raise NotADirectoryError(f"{path} is not a directory.") - if len(self.ls(path, refresh=True, detail=False)) > 0: + if len(self._listdir(bucket, max_items=1, prefix=key.rstrip("/") + "/")) > 0: raise TosfsError(f"Directory {path} is not empty.") try: