Commit 719384e3 authored by Damien Naudet's avatar Damien Naudet
Browse files

Fixed a problem occuring when retrieving the entries in an Xsocs file.

parent 86fcac36
......@@ -159,9 +159,12 @@ class XsocsH5(XsocsH5Base):
def _update_entries(self):
with self._get_file() as h5_file:
self.__entries = sorted([key for key in h5_file.keys()
if (h5_file[key].attrs.get('NX_class')
# TODO : this isnt pretty but for some reason the attrs.get() fails
# when there is no attribute NX_class (should return the default
# None)
self.__entries = sorted([key for key in h5_file
if ('NX_class' in h5_file[key].attrs and
h5_file[key].attrs['NX_class'] == 'NXentry')]) # noqa
def entries(self):
if self.__entries is None:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment