diff --git a/neo/core/regionofinterest.py b/neo/core/regionofinterest.py index 3de9b624f..da7ed0409 100644 --- a/neo/core/regionofinterest.py +++ b/neo/core/regionofinterest.py @@ -28,7 +28,8 @@ def _get_obj(self): return self.image_sequence def _set_obj(self, value): - assert isinstance(value, ImageSequence) + if not isinstance(value, ImageSequence): + raise TypeError(f"Value must be ImageSequence, not of type: {type(value)}") self.image_sequence = value obj = property(fget=_get_obj, fset=_set_obj)