]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
typed_subpart_iterator(): Fix these to use non-deprecated APIs,
authorBarry Warsaw <barry@python.org>
Wed, 26 Mar 2003 17:56:21 +0000 (17:56 +0000)
committerBarry Warsaw <barry@python.org>
Wed, 26 Mar 2003 17:56:21 +0000 (17:56 +0000)
i.e. get_content_maintype() and get_content_subtype().

Lib/email/_compat21.py

index 0e0b3d07652b4a7ecece63f2d2253e9c30c71c47..1e1f66692feb74efdc6f2ddde08bb0978c7d5f09 100644 (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