From 6754d52521f597caf3adae1b59d8d8bfbc18fbce Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 10 Jun 2003 16:31:55 +0000 Subject: [PATCH] get_payload(): Improve the TypeError message when the payload isn't of the expected type. In response to SF #751451. --- Lib/email/Message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/email/Message.py b/Lib/email/Message.py index 0f513f54985..6dfa84b4468 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: