diff options
author | Larry Hastings <larry@hastings.org> | 2014-03-17 05:54:05 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-03-17 05:54:05 (GMT) |
commit | 3c5c56f3c068bc13daea2275b951113b43a91e85 (patch) | |
tree | 1395bfb10902b7087a4ca1551f4bdb271b55ed43 /Lib/email | |
parent | e41b73caca2b543422f423a2ac07c29de834f44d (diff) | |
parent | 2221f666eba4a6f46f2095a801bc3e4bdbdb97d2 (diff) | |
download | cpython-3c5c56f3c068bc13daea2275b951113b43a91e85.zip cpython-3c5c56f3c068bc13daea2275b951113b43a91e85.tar.gz cpython-3c5c56f3c068bc13daea2275b951113b43a91e85.tar.bz2 |
Merged default into 3.4 branch. 3.4 branch is now effectively 3.4.1rc1.
Diffstat (limited to 'Lib/email')
-rw-r--r-- | Lib/email/message.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py index 88b5fa3..b4bc8cb 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -203,7 +203,11 @@ class Message: if self._payload is None: self._payload = [payload] else: - self._payload.append(payload) + try: + self._payload.append(payload) + except AttributeError: + raise TypeError("Attach is not valid on a message with a" + " non-multipart payload") def get_payload(self, i=None, decode=False): """Return a reference to the payload. |