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): ...@@ -63,7 +63,7 @@ def typed_subpart_iterator(msg, maintype='text', subtype=None):
""" """
parts = [] parts = []
for subpart in msg.walk(): for subpart in msg.walk():
if subpart.get_main_type('text') == maintype: if subpart.get_content_maintype() == maintype:
if subtype is None or subpart.get_subtype('plain') == subtype: if subtype is None or subpart.get_content_subtype() == subtype:
parts.append(subpart) parts.append(subpart)
return parts 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