Explorar el Código

Fix PartitionDefinition comparison in Python 3

Merges https://github.com/espressif/esp-idf/pull/2018
Marcin Jaworski hace 7 años
padre
commit
5bc1bf4add
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      components/partition_table/gen_esp32part.py

+ 12 - 0
components/partition_table/gen_esp32part.py

@@ -250,6 +250,18 @@ class PartitionDefinition(object):
     def __cmp__(self, other):
         return self.offset - other.offset
 
+    def __lt__(self, other):
+        return self.offset < other.offset
+
+    def __gt__(self, other):
+        return self.offset > other.offset
+
+    def __le__(self, other):
+        return self.offset <= other.offset
+
+    def __ge__(self, other):
+        return self.offset >= other.offset
+
     def parse_type(self, strval):
         if strval == "":
             raise InputError("Field 'type' can't be left empty.")