summaryrefslogtreecommitdiffstats
path: root/Lib/email
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-03-17 05:54:05 (GMT)
committerLarry Hastings <larry@hastings.org>2014-03-17 05:54:05 (GMT)
commit3c5c56f3c068bc13daea2275b951113b43a91e85 (patch)
tree1395bfb10902b7087a4ca1551f4bdb271b55ed43 /Lib/email
parente41b73caca2b543422f423a2ac07c29de834f44d (diff)
parent2221f666eba4a6f46f2095a801bc3e4bdbdb97d2 (diff)
downloadcpython-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.py6
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.