Implement Section.__hash__() to avoid Python 2’s DeprecationWarning
authorMartin Panter <vadmium à gmail·com>
Thu, 13 Feb 2014 11:18:36 +0000 (11:18 +0000)
committerMartin Panter <vadmium à gmail·com>
Thu, 1 May 2014 12:02:27 +0000 (12:02 +0000)
elftools/elf/sections.py

index ce6245057ee798380755e0e60c426bc144897d15..5b200ed511f5f359be1bccbac7e1c2a1aeeb293d 100644 (file)
@@ -41,6 +41,8 @@ class Section(object):
 
     def __eq__(self, other):
         return self.header == other.header
+    def __hash__(self):
+        return hash(self.header)
 
 
 class NullSection(Section):