data_item: handle __eq__ if other == None

Currently it is not possible to check if data_item == None,
as __eq__ tries to access .data in 'None' object and thus
throws an exception.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2017-08-19 20:10:54 +03:00
parent c3a43c6d84
commit 3acc2146fa
+3
View File
@@ -62,6 +62,9 @@ class DataItem(object):
return self.data.dvc.__hash__()
def __eq__(self, other):
if other == None:
return False
return self.data.dvc == other.data.dvc
@property