From: Barry Warsaw Date: Tue, 10 Jun 2003 16:31:55 +0000 (+0000) Subject: get_payload(): Improve the TypeError message when the payload isn't of X-Git-Tag: v2.3c1~501 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6754d52521f597caf3adae1b59d8d8bfbc18fbce;p=python get_payload(): Improve the TypeError message when the payload isn't of the expected type. In response to SF #751451. --- diff --git a/Lib/email/Message.py b/Lib/email/Message.py index 0f513f5498..6dfa84b446 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: