Skip to content

Commit f97f432

Browse files
Apply ruff/tryceratops rule TRY300
TRY300 Consider moving this statement to an `else` block
1 parent 6fd95c9 commit f97f432

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/zarr/group.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,10 @@ async def contains(self, member: str) -> bool:
424424
# TODO: this can be made more efficient.
425425
try:
426426
await self.getitem(member)
427-
return True
428427
except KeyError:
429428
return False
429+
else:
430+
return True
430431

431432
# todo: decide if this method should be separate from `groups`
432433
async def group_keys(self) -> AsyncGenerator[str, None]:

src/zarr/store/remote.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ async def get(
105105
else self._fs._cat_file(path)
106106
)
107107
)
108-
return value
109108

110109
except self.allowed_exceptions:
111110
return None
@@ -114,6 +113,8 @@ async def get(
114113
# this is an s3-specific condition we probably don't want to leak
115114
return prototype.buffer.from_bytes(b"")
116115
raise
116+
else:
117+
return value
117118

118119
async def set(
119120
self,

0 commit comments

Comments
 (0)