diff options
author | Barry Warsaw <barry@python.org> | 2001-10-15 04:38:22 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-10-15 04:38:22 (GMT) |
commit | 0164b6bf227ca920af52608784f5c5605b6d3283 (patch) | |
tree | 59cd14082de446cc11616b75f8367a2395c9462a /Lib/email | |
parent | 0fae49fc7b558836553f2e800f2b9a0bdcf31e45 (diff) | |
download | cpython-0164b6bf227ca920af52608784f5c5605b6d3283.zip cpython-0164b6bf227ca920af52608784f5c5605b6d3283.tar.gz cpython-0164b6bf227ca920af52608784f5c5605b6d3283.tar.bz2 |
typed_subpart_iterator(): When getting the main type use 'text' as the
failobj, and when getting the subtype use 'plain' as the failobj.
text/plain is supposed to be the default if the message contains no
Content-Type: header.
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/Iterators.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/email/Iterators.py b/Lib/email/Iterators.py index d1ee53f..a64495d 100644 --- a/Lib/email/Iterators.py +++ b/Lib/email/Iterators.py @@ -28,6 +28,6 @@ def typed_subpart_iterator(msg, maintype='text', subtype=None): omitted, only the main type is matched. """ for subpart in msg.walk(): - if subpart.get_main_type() == maintype: - if subtype is None or subpart.get_subtype() == subtype: + if subpart.get_main_type('text') == maintype: + if subtype is None or subpart.get_subtype('plain') == subtype: yield subpart |