mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue