diff --git a/labrad/test/test_types.py b/labrad/test/test_types.py index f3c54f2..c5a8547 100644 --- a/labrad/test/test_types.py +++ b/labrad/test/test_types.py @@ -184,7 +184,7 @@ def compareValueArrays(a, b): (ValueArray([1.0, 2], ''), np.array([1.0, 2]), np.testing.assert_array_almost_equal), # Numpy scalar types - (np.bool8(True), True, None) + (np.bool_(True), True, None) ] for input, expected, comparison_func in tests: unflat = T.unflatten(*T.flatten(input)) diff --git a/labrad/types/types.py b/labrad/types/types.py index a41385f..c0ba408 100644 --- a/labrad/types/types.py +++ b/labrad/types/types.py @@ -598,12 +598,12 @@ def __unflatten__(self, s, endianness): return bool(ord(s.get(1))) def __flatten__(self, b, endianness): - if not isinstance(b, (bool, np.bool8)): + if not isinstance(b, (bool, np.bool_)): raise FlatteningError(b, self) return b'\x01' if b else b'\x00', self registerType(bool, TBool()) -registerType(np.bool8, TBool()) +registerType(np.bool_, TBool()) class TInt(Type, Singleton): """A signed 32-bit integer."""