From dfea3b3963228fc149c586463b01fcaf39510902 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 20 Aug 2002 14:47:30 +0000 Subject: _dispatch(): Use get_content_maintype() and get_content_subtype() to get the MIME main and sub types, instead of getting the whole ctype and splitting it here. The two more specific methods now correctly implement RFC 2045, section 5.2. --- Lib/email/Generator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Lib/email/Generator.py') diff --git a/Lib/email/Generator.py b/Lib/email/Generator.py index a8e2cfe57d..8ce380725d 100644 --- a/Lib/email/Generator.py +++ b/Lib/email/Generator.py @@ -123,9 +123,8 @@ class Generator: # self._handle__(). If there's no handler for the # full MIME type, then dispatch to self._handle_(). If # that's missing too, then dispatch to self._writeBody(). - ctype = msg.get_content_type() - # We do have a Content-Type: header. - main, sub = ctype.split('/') + main = msg.get_content_maintype() + sub = msg.get_content_subtype() specific = UNDERSCORE.join((main, sub)).replace('-', '_') meth = getattr(self, '_handle_' + specific, None) if meth is None: -- cgit v1.2.1