diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-07-30 17:27:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 17:27:06 (GMT) |
commit | 6f950023c6a2168b229363d75f59a24ecdd66d19 (patch) | |
tree | 3d4c88a355e77cf1c35b8f94718667a0c959463c /Lib/email | |
parent | 843b3d28209b7754c51c6cc3844f66808b6dbdaf (diff) | |
download | cpython-6f950023c6a2168b229363d75f59a24ecdd66d19.zip cpython-6f950023c6a2168b229363d75f59a24ecdd66d19.tar.gz cpython-6f950023c6a2168b229363d75f59a24ecdd66d19.tar.bz2 |
bpo-42892: fix email multipart attribute error (GH-26903) (GH-27492)
(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.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): |