diff Lib/email/Iterators.py @ 20426:518e30f90d1f legacy-trunk

typed_subpart_iterator(): When getting the main type use 'text' as the failobj, and when getting the subtype use 'plain' as the failobj. text/plain is supposed to be the default if the message contains no Content-Type: header.
author Barry Warsaw <barry@python.org>
date Mon, 15 Oct 2001 04:38:22 +0000
parents d96cd38a3fec
children 13fb4d16f604 534aab5bccea
line wrap: on
line diff
--- a/Lib/email/Iterators.py	Sun Oct 14 04:45:51 2001 +0000
+++ b/Lib/email/Iterators.py	Mon Oct 15 04:38:22 2001 +0000
@@ -28,6 +28,6 @@
     omitted, only the main type is matched.
     """
     for subpart in msg.walk():
-        if subpart.get_main_type() == maintype:
-            if subtype is None or subpart.get_subtype() == subtype:
+        if subpart.get_main_type('text') == maintype:
+            if subtype is None or subpart.get_subtype('plain') == subtype:
                 yield subpart