From: Barry Warsaw Date: Wed, 26 Mar 2003 17:56:21 +0000 (+0000) Subject: typed_subpart_iterator(): Fix these to use non-deprecated APIs, X-Git-Tag: v2.3c1~1362 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8af56778fd7753252861baab3fa00ac3696ddbc6;p=thirdparty%2FPython%2Fcpython.git typed_subpart_iterator(): Fix these to use non-deprecated APIs, i.e. get_content_maintype() and get_content_subtype(). --- diff --git a/Lib/email/_compat21.py b/Lib/email/_compat21.py index 0e0b3d07652b..1e1f66692feb 100644 --- a/Lib/email/_compat21.py +++ b/Lib/email/_compat21.py @@ -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