diff options
author | andrei kulakov <andrei.avk@gmail.com> | 2021-07-30 17:05:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 17:05:49 (GMT) |
commit | e3f877c32d7cccb734f45310f26beeec793364ce (patch) | |
tree | b00453971c06bf746c6822657ddeb1f5a9e61a29 /Lib/email | |
parent | 4bd9caafb64589288e5171087070bde726178c58 (diff) | |
download | cpython-e3f877c32d7cccb734f45310f26beeec793364ce.zip cpython-e3f877c32d7cccb734f45310f26beeec793364ce.tar.gz cpython-e3f877c32d7cccb734f45310f26beeec793364ce.tar.bz2 |
bpo-42892: fix email multipart attribute error (GH-26903)
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/message.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py index db30d9a..6752ce0 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): |