summaryrefslogtreecommitdiff
path: root/src/leap/mail/imap
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
commitbed4a7b6abffe9d8cb9178b9dc89d13d9d87c1e8 (patch)
treea9c2035c9ee974696c4d105ec570520f087a7b06 /src/leap/mail/imap
parentd9b37a7a1115b76ebc72413cf1ffe9a613b58d52 (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 'src/leap/mail/imap')
-rw-r--r--src/leap/mail/imap/messages.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/mail/imap/messages.py b/src/leap/mail/imap/messages.py
index 6ff3967..4a07ef7 100644
--- a/src/leap/mail/imap/messages.py
+++ b/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: