# Copyright (C) 2002 Python Software Foundation
# Author: barry@zope.com
-"""Module containing compatibility functions for Python 2.1.
+"""Module containing compatibility functions for Python 2.2.
"""
from __future__ import generators
from cStringIO import StringIO
from types import StringTypes
+# Python 2.2.x where x < 2 lacks True/False
+try:
+ True, False
+except NameError:
+ True = 1
+ False = 0
+
\f
# This function will become a method of the Message class
omitted, only the main type is matched.
"""
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:
yield subpart