forked from pool/python-pypet
* Support for NumPy >= 1.20 - Drop patch support-numpy-1.20.patch, included upstream. - Add patch do-not-decode-int.patch, do not call .decode() on ints when storing them. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-pypet?expand=0&rev=12
15 lines
783 B
Diff
15 lines
783 B
Diff
Index: pypet-0.6.1/pypet/storageservice.py
|
|
===================================================================
|
|
--- pypet-0.6.1.orig/pypet/storageservice.py
|
|
+++ pypet-0.6.1/pypet/storageservice.py
|
|
@@ -3175,7 +3175,8 @@ class HDF5StorageService(StorageService,
|
|
# in the list or tuple
|
|
for idx, item in enumerate(data):
|
|
if typestr == str.__name__:
|
|
- data[idx] = data[idx].decode(self._encoding)
|
|
+ if hasattr(data[idx], "decode"):
|
|
+ data[idx] = data[idx].decode(self._encoding)
|
|
else:
|
|
try:
|
|
data[idx] = pypetconstants.PARAMETERTYPEDICT[typestr](item)
|