summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-07-19 22:21:02 (GMT)
committerBarry Warsaw <barry@python.org>2002-07-19 22:21:02 (GMT)
commit1cecdc6bcb3226c2a0a071406e3b06308fbb1369 (patch)
treefea8952a5846465f8fd33432884e87a664899af1 /Lib/email
parentc441f7b3a6f06e442a08646f857b2c7b5f3018a0 (diff)
downloadcpython-1cecdc6bcb3226c2a0a071406e3b06308fbb1369.zip
cpython-1cecdc6bcb3226c2a0a071406e3b06308fbb1369.tar.gz
cpython-1cecdc6bcb3226c2a0a071406e3b06308fbb1369.tar.bz2
_dispatch(): Use the new Message.get_content_type() method as hashed
out on the mimelib-devel list.
Diffstat (limited to 'Lib/email')
-rw-r--r--Lib/email/Generator.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/email/Generator.py b/Lib/email/Generator.py
index 9377b53..a8e2cfe 100644
--- a/Lib/email/Generator.py
+++ b/Lib/email/Generator.py
@@ -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('-', '_')