python (3.12.0)
1 # Copyright (C) 2002-2006 Python Software Foundation
2 # Author: Barry Warsaw
3 # Contact: email-sig@python.org
4
5 """Base class for MIME type messages that are not multipart."""
6
7 __all__ = ['MIMENonMultipart']
8
9 from email import errors
10 from email.mime.base import MIMEBase
11
12
13 class ESC[4;38;5;81mMIMENonMultipart(ESC[4;38;5;149mMIMEBase):
14 """Base class for MIME non-multipart type messages."""
15
16 def attach(self, payload):
17 # The public API prohibits attaching multiple subparts to MIMEBase
18 # derived subtypes since none of them are, by definition, of content
19 # type multipart/*
20 raise errors.MultipartConversionError(
21 'Cannot attach additional subparts to non-multipart/*')