mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
typed_subpart_iterator(): Fix these to use non-deprecated APIs,
i.e. get_content_maintype() and get_content_subtype().
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user