From ef7155224cc650b07e6f317ef8a28fb4ef83e1e8 Mon Sep 17 00:00:00 2001 From: Stefan Hojer Date: Fri, 15 May 2015 22:28:33 +0200 Subject: [PATCH] Removed exception from Row.__cmp__() Removed the exception from Row.__cmp__() as the exception effectively disabled valid comparisons. cmp(somethingdifferent, rowinstance) should be False and should be False if the types do not match. --- src/carbon/common/script/sys/row.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carbon/common/script/sys/row.py b/src/carbon/common/script/sys/row.py index 8746232..1eec8e6 100644 --- a/src/carbon/common/script/sys/row.py +++ b/src/carbon/common/script/sys/row.py @@ -27,7 +27,7 @@ def __eq__(self, other): def __cmp__(self, other): if not isinstance(other, Row): - raise TypeError("Incompatible comparison type") + return False return cmp(self.header, other.header) or cmp(self.line, other.line) def __str__(self):