Skip to content

Commit b536e37

Browse files
authored
gh-130433: Update documentation for MultipartConversionError (GH-130436)
1 parent baae9cb commit b536e37

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Doc/library/email.errors.rst

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,12 @@ The following exception classes are defined in the :mod:`email.errors` module:
4545

4646
.. exception:: MultipartConversionError()
4747

48-
Raised when a payload is added to a :class:`~email.message.Message` object
49-
using :meth:`add_payload`, but the payload is already a scalar and the
50-
message's :mailheader:`Content-Type` main type is not either
51-
:mimetype:`multipart` or missing. :exc:`MultipartConversionError` multiply
52-
inherits from :exc:`MessageError` and the built-in :exc:`TypeError`.
53-
54-
Since :meth:`Message.add_payload` is deprecated, this exception is rarely
55-
raised in practice. However the exception may also be raised if the
56-
:meth:`~email.message.Message.attach`
57-
method is called on an instance of a class derived from
48+
Raised if the :meth:`~email.message.Message.attach` method is called
49+
on an instance of a class derived from
5850
:class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g.
5951
:class:`~email.mime.image.MIMEImage`).
52+
:exc:`MultipartConversionError` multiply
53+
inherits from :exc:`MessageError` and the built-in :exc:`TypeError`.
6054

6155

6256
.. exception:: HeaderWriteError()

0 commit comments

Comments
 (0)