summaryrefslogtreecommitdiff
path: root/loader/lib/parser.py
diff options
context:
space:
mode:
authorMagnus Hagander2019-01-03 20:57:48 +0000
committerMagnus Hagander2019-01-04 11:24:06 +0000
commita8ac4da80f873aac35d8ae3e38b975b9757c1398 (patch)
tree0892ab27576158a7e8ca5feb7875937e1806557b /loader/lib/parser.py
parent635fb4fbe2cf995830159d8bcf65c2a4a1e7b73d (diff)
Fix comparison operators
Diffstat (limited to 'loader/lib/parser.py')
-rw-r--r--loader/lib/parser.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/loader/lib/parser.py b/loader/lib/parser.py
index 334fc34..d22d8b0 100644
--- a/loader/lib/parser.py
+++ b/loader/lib/parser.py
@@ -62,7 +62,7 @@ class ArchivesParser(object):
# mailers that add the same reference more than once. And we can't
# use a set() to make it unique, because order is very important
for m in cleaned_msgids:
- if m and not m in self.parents:
+ if m and m not in self.parents:
self.parents.append(m)
def clean_charset(self, charset):
@@ -230,7 +230,7 @@ class ArchivesParser(object):
# This was not a multipart, but it leaked... Give up!
return None
for p in pl:
- if p.get_params() == None:
+ if p.get_params() is None:
# MIME multipart/mixed, but no MIME type on the part
log.status("Found multipart/mixed in message '%s', but no MIME type on part. Trying text/plain." % self.msgid)
return self.get_payload_as_unicode(p)
@@ -296,7 +296,7 @@ class ArchivesParser(object):
# ignore it...
return
for p in container.get_payload():
- if p.get_params() == None:
+ if p.get_params() is None:
continue
self.recursive_get_attachments(p)
elif container.get_content_type() == 'multipart/alternative':
@@ -480,7 +480,7 @@ class ArchivesParser(object):
_re_mailworkaround = re.compile('"(=\?[^\?]+\?[QB]\?[^\?]+\?=)"', re.IGNORECASE)
def _decode_mime_header(self, hdr, email_workaround):
- if hdr == None:
+ if hdr is None:
return None
# Per http://bugs.python.org/issue504152 (and lots of testing), it seems
@@ -524,7 +524,7 @@ class ArchivesParser(object):
def get_mandatory(self, fieldname):
try:
x = self.msg[fieldname]
- if x == None:
+ if x is None:
raise Exception()
return x
except: