Skip to content

Commit 20d4177

Browse files
committed
[datatype] fix np removal of unicode_ for versions > 2.0
1 parent 084e770 commit 20d4177

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nixio/datatype.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# LICENSE file in the root of the Project.
99
from numbers import Integral, Real
1010
from six import string_types
11+
from packaging import version
1112

1213
import numpy as np
1314

@@ -26,7 +27,10 @@ class DataType(object):
2627
Int64 = np.int64
2728
Float = np.float32
2829
Double = np.double
29-
String = np.unicode_
30+
if version.parse(np.__version__) < version.parse("2.0"):
31+
String = np.unicode_
32+
else:
33+
String = np.str_
3034
Bool = np.bool_
3135

3236
# type groups

0 commit comments

Comments
 (0)