]> granicus.if.org Git - esp-idf/commitdiff
Fix PartitionDefinition comparison in Python 3
authorMarcin Jaworski <marcin@jaworski.me>
Thu, 31 May 2018 14:26:38 +0000 (16:26 +0200)
committerAngus Gratton <gus@projectgus.com>
Mon, 4 Jun 2018 07:18:41 +0000 (17:18 +1000)
Merges https://github.com/espressif/esp-idf/pull/2018

components/partition_table/gen_esp32part.py

index 275976b741f0897d4b5dafeb98e3f1ce7ac1bfb0..0e3a0b7e95a76921f8395fa1c28cccf667f76a5a 100755 (executable)
@@ -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.")