Skip to content

Commit f3c52dc

Browse files
committed
raise AttributeError in __getattr__ if lookup fails
1 parent befd48d commit f3c52dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

zarr/hierarchy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,10 @@ def _delitem_nosync(self, item):
319319

320320
def __getattr__(self, item):
321321
# allow access to group members via dot notation
322-
return self.__getitem__(item)
322+
try:
323+
return self.__getitem__(item)
324+
except KeyError:
325+
raise AttributeError
323326

324327
def group_keys(self):
325328
"""Return an iterator over member names for groups only.

0 commit comments

Comments
 (0)