From 3acc2146fa3bec91d33261049e665a760bb564a2 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sat, 19 Aug 2017 15:42:47 +0300 Subject: [PATCH] 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 --- dvc/path/data_item.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dvc/path/data_item.py b/dvc/path/data_item.py index 04fb341a1..90e2fbff4 100644 --- a/dvc/path/data_item.py +++ b/dvc/path/data_item.py @@ -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