mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-42892: fix email multipart attribute error (GH-26903)
This commit is contained in:
parent
4bd9caafb6
commit
e3f877c32d
3 changed files with 36 additions and 3 deletions
|
@ -982,7 +982,7 @@ class MIMEPart(Message):
|
|||
if subtype in preferencelist:
|
||||
yield (preferencelist.index(subtype), part)
|
||||
return
|
||||
if maintype != 'multipart':
|
||||
if maintype != 'multipart' or not self.is_multipart():
|
||||
return
|
||||
if subtype != 'related':
|
||||
for subpart in part.iter_parts():
|
||||
|
@ -1087,7 +1087,7 @@ class MIMEPart(Message):
|
|||
|
||||
Return an empty iterator for a non-multipart.
|
||||
"""
|
||||
if self.get_content_maintype() == 'multipart':
|
||||
if self.is_multipart():
|
||||
yield from self.get_payload()
|
||||
|
||||
def get_content(self, *args, content_manager=None, **kw):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue