From c67dd0c3994949be42d9da847599cd600d4bac33 Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Thu, 28 Mar 2019 13:26:07 +0100 Subject: [PATCH] Note to self: run the unit tests before making a commit!! --- pyNN/common/populations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyNN/common/populations.py b/pyNN/common/populations.py index 202d74e25..52a5edac9 100644 --- a/pyNN/common/populations.py +++ b/pyNN/common/populations.py @@ -1144,7 +1144,7 @@ def __getitem__(self, index): pindex = boundaries[1:].searchsorted(index, side='right') return self.populations[pindex][index - boundaries[pindex]] elif isinstance(index, (slice, tuple, list, numpy.ndarray)): - if isinstance(index, slice) or index.dtype == bool: + if isinstance(index, slice) or (hasattr(index, "dtype") and index.dtype == bool): indices = numpy.arange(self.size)[index] else: indices = numpy.array(index)