Skip to content

Commit a860e63

Browse files
committed
hdf5_handler.get_string(): HIGH PRIORITY COMPATIBILITY FIX: fix error due to variable type (required for Python 3.8) - mimics commit CLIMADA-project@c5e72b4.
1 parent b9d0c49 commit a860e63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

climada/util/hdf5_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def read(file_name, with_refs=False):
5656
Exception while reading
5757
"""
5858
def get_group(group):
59-
'''Recursive function to get variables from a group.'''
59+
"""Recursive function to get variables from a group."""
6060
contents = {}
6161
for name, obj in list(group.items()):
6262
if isinstance(obj, h5py.Dataset):
@@ -86,7 +86,7 @@ def get_string(array):
8686
Returns:
8787
string
8888
"""
89-
return u''.join(chr(c) for c in array)
89+
return u''.join(chr(int(c)) for c in array)
9090

9191
def get_str_from_ref(file_name, var):
9292
"""Form string from a reference HDF5 variable of the given file.

0 commit comments

Comments
 (0)