projects
/
pyelftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60319cb
)
Check for header attribute when comparing
author
tezeb
<tezeb@users.noreply.github.com>
Sun, 25 Sep 2016 18:18:02 +0000
(20:18 +0200)
committer
tezeb
<tezeb@outoftheblue.pl>
Tue, 4 Oct 2016 11:56:17 +0000
(13:56 +0200)
When checking against None it throws exception, while it's quite
easy to prevent(and check against None seems quite obvious).
elftools/elf/sections.py
patch
|
blob
|
history
diff --git
a/elftools/elf/sections.py
b/elftools/elf/sections.py
index 205805368a993f17af43b6ce05f719b8edbdc383..76f9f2a6b1074e633a06ad97bd6c476aeeb4e356 100644
(file)
--- a/
elftools/elf/sections.py
+++ b/
elftools/elf/sections.py
@@
-41,7
+41,11
@@
class Section(object):
return self.header[name]
def __eq__(self, other):
- return self.header == other.header
+ try:
+ return self.header == other.header
+ except AttributeError:
+ return False
+
def __hash__(self):
return hash(self.header)