From a5ecb2b07bd47e7549dd989b500eb9b31e34fec7 Mon Sep 17 00:00:00 2001 From: Benjamin Jakimow <benjamin.jakimow@geo.hu-berlin.de> Date: Mon, 26 Jun 2017 23:44:37 +0200 Subject: [PATCH] improved SensorInstrument.__eq__(self, other) by checking type of "other" first --- timeseriesviewer/timeseries.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/timeseriesviewer/timeseries.py b/timeseriesviewer/timeseries.py index 4ecce59d..053933df 100644 --- a/timeseriesviewer/timeseries.py +++ b/timeseriesviewer/timeseries.py @@ -156,6 +156,8 @@ class SensorInstrument(QObject): self.wavelengthUnits is not None def __eq__(self, other): + if not isinstance(other, SensorInstrument): + return False return self.nb == other.nb and \ self.px_size_x == other.px_size_x and \ self.px_size_y == other.px_size_y -- GitLab