summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-01-31 20:27:28 -0400
committerKali Kaneko <kali@leap.se>2014-01-31 20:27:28 -0400
commit5ffa2bf96429ef320eef00d71364ffe4ec3d367b (patch)
tree0be3fdcd145eed98cc5caf1c4a20e0898fd1d403 /mail
parentc62c5497351a0ae89be49f9b829d89043476802b (diff)
Restore expected TypeError.
I must have removed this to get rid of a error with some test sample during the testing of the branch, but it's absolutely needed so that mime attachments get shown properly. If the TypeError raises inapropiately due to some malformed part_map, then we will have to catch it using a workaround somewhere else.
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/imap/messages.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mail/src/leap/mail/imap/messages.py b/mail/src/leap/mail/imap/messages.py
index 6ff39671..4a07ef77 100644
--- a/mail/src/leap/mail/imap/messages.py
+++ b/mail/src/leap/mail/imap/messages.py
@@ -299,7 +299,9 @@ class LeapMessage(fields, MailParser, MBoxParser):
return fd
# TODO refactor with getBodyFile in MessagePart
+
fd = StringIO.StringIO()
+
if self._bdoc is not None:
bdoc_content = self._bdoc.content
if empty(bdoc_content):
@@ -456,8 +458,8 @@ class LeapMessage(fields, MailParser, MBoxParser):
:rtype: Any object implementing C{IMessagePart}.
:return: The specified sub-part.
"""
- #if not self.isMultipart():
- #raise TypeError
+ if not self.isMultipart():
+ raise TypeError
try:
pmap_dict = self._get_part_from_parts_map(part + 1)
except KeyError: