summaryrefslogtreecommitdiffstats
path: root/Lib/email/Message.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2003-06-10 16:31:55 (GMT)
committerBarry Warsaw <barry@python.org>2003-06-10 16:31:55 (GMT)
commit6754d52521f597caf3adae1b59d8d8bfbc18fbce (patch)
treebb57de2f30b153478892190cd2928640fdd45b72 /Lib/email/Message.py
parent9caa0d1642b79020a1665560e6efaedabfadfba3 (diff)
downloadcpython-6754d52521f597caf3adae1b59d8d8bfbc18fbce.zip
cpython-6754d52521f597caf3adae1b59d8d8bfbc18fbce.tar.gz
cpython-6754d52521f597caf3adae1b59d8d8bfbc18fbce.tar.bz2
get_payload(): Improve the TypeError message when the payload isn't of
the expected type. In response to SF #751451.
Diffstat (limited to 'Lib/email/Message.py')
-rw-r--r--Lib/email/Message.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/email/Message.py b/Lib/email/Message.py
index 0f513f5..6dfa84b 100644
--- a/Lib/email/Message.py
+++ b/Lib/email/Message.py
@@ -186,7 +186,7 @@ class Message:
if i is None:
payload = self._payload
elif not isinstance(self._payload, ListType):
- raise TypeError, i
+ raise TypeError, 'Expected list, got %s' % type(self._payload)
else:
payload = self._payload[i]
if decode: