diff --git a/tosfs/core.py b/tosfs/core.py index 324a8d9..184177a 100644 --- a/tosfs/core.py +++ b/tosfs/core.py @@ -846,9 +846,11 @@ def isdir(self, path: str) -> bool: except TosServerError as e: if e.status_code == TOS_SERVER_STATUS_CODE_NOT_FOUND: return False - if (self._get_bucket_type(bucket) == TOS_BUCKET_TYPE_HNS + if ( + self._get_bucket_type(bucket) == TOS_BUCKET_TYPE_HNS and e.status_code == CONFLICT_CODE - and e.header._store["x-tos-ec"][1] == "0026-00000020"): + and e.header._store["x-tos-ec"][1] == "0026-00000020" + ): out = retryable_func_executor( lambda: self.tos_client.list_objects_type2( bucket,