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

i.e. get_content_maintype() and get_content_subtype().
This commit is contained in:
Barry Warsaw 2003-03-26 17:56:21 +00:00
parent 11cfbd6ef2
commit 8af56778fd

View file

@ -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