Skip to content

Commit

Permalink
Fix exists return non-bool value (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua authored Oct 8, 2024
1 parent 460507b commit cb5421e
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 @@ -570,7 +570,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 @@ -580,7 +580,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 cb5421e

Please sign in to comment.