mirror of https://github.com/python/cpython.git
get_payload(): Improve the TypeError message when the payload isn't of
the expected type. In response to SF #751451.
This commit is contained in:
parent
9caa0d1642
commit
6754d52521
|
@ -186,7 +186,7 @@ def get_payload(self, i=None, decode=False):
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue