python: Fix inequality comparisons
[mesa.git] / src / gallium / auxiliary / util / u_format_parse.py
index d3874cd895b8d3e55ca73be2c59bea74cee2be46..48cc012cd2a76e175ece815a37acde2e713c543b 100644 (file)
@@ -72,8 +72,14 @@ class Channel:
         return s
 
     def __eq__(self, other):
+        if other is None:
+            return False
+
         return self.type == other.type and self.norm == other.norm and self.pure == other.pure and self.size == other.size
 
+    def __ne__(self, other):
+        return not self == other
+
     def max(self):
         '''Maximum representable number.'''
         if self.type == FLOAT: