]> granicus.if.org Git - python/commitdiff
get_payload(): Improve the TypeError message when the payload isn't of
authorBarry Warsaw <barry@python.org>
Tue, 10 Jun 2003 16:31:55 +0000 (16:31 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 10 Jun 2003 16:31:55 +0000 (16:31 +0000)
the expected type.  In response to SF #751451.

Lib/email/Message.py

index 0f513f5498560685e184fbda0955317a27ee1a13..6dfa84b44680ffa4d8269181e299a5584ec543c0 100644 (file)
@@ -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: