0001-storage-handle-tuple-likes-in-deep_bytes2str.patch
wcs/qommon/storage.py | ||
---|---|---|
122 | 122 |
return obj |
123 | 123 |
if isinstance(obj, list): |
124 | 124 |
return [deep_bytes2str(x, seen) for x in obj] |
125 |
if type(obj) is tuple: # real tuple |
|
126 |
return type(obj)(deep_bytes2str(x, seen) for x in obj) |
|
127 |
elif isinstance(obj, tuple) and hasattr(type(obj), '_replace'): # namedtuple |
|
128 |
return type(obj)(*[deep_bytes2str(x, seen) for x in obj]) |
|
125 | 129 |
if id(obj) in seen: |
126 | 130 |
return obj |
127 | 131 |
seen[id(obj)] = True |
128 |
- |