Given a non-deserializable object, make a best effort to return a useful set of results.
(b)
| 47 | |
| 48 | |
| 49 | def decode_list(b): |
| 50 | """ |
| 51 | Given a non-deserializable object, make a best effort to |
| 52 | return a useful set of results. |
| 53 | """ |
| 54 | if isinstance(b, list): |
| 55 | return [nativestr(obj) for obj in b] |
| 56 | elif isinstance(b, bytes): |
| 57 | return unstring(nativestr(b)) |
| 58 | elif isinstance(b, str): |
| 59 | return unstring(b) |
| 60 | return b |