Commit 8af56778 authored by Barry Warsaw's avatar Barry Warsaw

typed_subpart_iterator(): Fix these to use non-deprecated APIs,

i.e. get_content_maintype() and get_content_subtype().
parent 11cfbd6e
......@@ -63,7 +63,7 @@ def typed_subpart_iterator(msg, maintype='text', subtype=None):
"""
parts = []
for subpart in msg.walk():
if subpart.get_main_type('text') == maintype:
if subtype is None or subpart.get_subtype('plain') == subtype:
if subpart.get_content_maintype() == maintype:
if subtype is None or subpart.get_content_subtype() == subtype:
parts.append(subpart)
return parts
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment