mirror of
https://github.com/python/cpython.git
synced 2026-01-03 14:02:21 +00: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:
parent
11cfbd6ef2
commit
8af56778fd
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue