summaryrefslogtreecommitdiff
path: root/Lib/email
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-07-30 10:30:58 -0700
committerGitHub <noreply@github.com>2021-07-30 19:30:58 +0200
commit0f42b726c87f72d522893f927b4cb592b8875641 (patch)
tree671bf045ce82f4b5eb4c72ca723833b99d8be466 /Lib/email
parentb57011d2a5375bc9f255361dc64c9e6fbc203e0e (diff)
downloadcpython-git-0f42b726c87f72d522893f927b4cb592b8875641.tar.gz
bpo-42892: fix email multipart attribute error (GH-26903) (GH-27493)
(cherry picked from commit e3f877c32d7cccb734f45310f26beeec793364ce) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/message.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py
index db30d9a170..6752ce0fa1 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -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):