Skip to content

Commit

Permalink
Fix instance check of collections.iterable to remove DeprecationWarni…
Browse files Browse the repository at this point in the history
…ng and ensure future compatibility with python 3.8
  • Loading branch information
Maximilian committed Apr 1, 2019
1 parent f8b7009 commit 4e50090
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions h5py_wrapper/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def _dict_to_h5(f, d, overwrite_dataset, compression=None, parent_group=None):
if parent_group is None:
parent_group = f.parent
for key, value in d.items():
if isinstance(value, collections.MutableMapping):
if isinstance(value, collections.abc.MutableMapping):
group_name = os.path.join(parent_group.name, str(key))
group = f.require_group(group_name)
_dict_to_h5(f, value, overwrite_dataset, parent_group=group,
Expand Down Expand Up @@ -227,7 +227,7 @@ def _create_dataset(parent_group, key, value, compression=None):
dataset = parent_group.create_dataset(
str(key), data=lib.convert_iterable_to_numpy_array(value), compression=compression)
# ignore compression argument for scalar datasets
elif not isinstance(value, collections.Iterable):
elif not isinstance(value, collections.abc.Iterable):
dataset = parent_group.create_dataset(str(key), data=value)
else:
dataset = parent_group.create_dataset(
Expand Down

0 comments on commit 4e50090

Please sign in to comment.