mirror of
https://github.com/python/cpython
synced 2026-09-29 09:25:29 +03:00
_dispatch(): Use the new Message.get_content_type() method as hashed
out on the mimelib-devel list.
This commit is contained in:
parent
c441f7b3a6
commit
1cecdc6bcb
1 changed files with 1 additions and 6 deletions
|
|
@ -123,12 +123,7 @@ class Generator:
|
|||
# self._handle_<maintype>_<subtype>(). If there's no handler for the
|
||||
# full MIME type, then dispatch to self._handle_<maintype>(). If
|
||||
# that's missing too, then dispatch to self._writeBody().
|
||||
ctype = msg.get_type()
|
||||
if ctype is None:
|
||||
# No Content-Type: header so use the default type, which must be
|
||||
# either text/plain or message/rfc822.
|
||||
ctype = msg.get_default_type()
|
||||
assert ctype in ('text/plain', 'message/rfc822')
|
||||
ctype = msg.get_content_type()
|
||||
# We do have a Content-Type: header.
|
||||
main, sub = ctype.split('/')
|
||||
specific = UNDERSCORE.join((main, sub)).replace('-', '_')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue