Skip to content

Commit

Permalink
Fix exists return non-bool value
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua committed Sep 29, 2024
1 parent 4099b15 commit 95431c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tosfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def exists(self, path: str, **kwargs: Any) -> bool:

try:
return retryable_func_executor(
lambda: self.tos_client.head_object(bucket, key) or True,
lambda: self.tos_client.head_object(bucket, key) and True,
max_retry_num=self.max_retry_num,
)
except TosServerError as e:
Expand All @@ -536,7 +536,7 @@ def exists(self, path: str, **kwargs: Any) -> bool:
lambda: self.tos_client.head_object(
bucket, key.rstrip("/") + "/"
)
or True,
and True,
max_retry_num=self.max_retry_num,
)
except TosServerError as ex:
Expand Down

0 comments on commit 95431c4

Please sign in to comment.