# 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):
# 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)
# 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':
_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
def get_mandatory(self, fieldname):
try:
x = self.msg[fieldname]
- if x == None:
+ if x is None:
raise Exception()
return x
except: