Merge pull request #171 from Ark-kun/patch-1

Fixed Watch.unmarshal_event when data is not a JSON-serialized object
This commit is contained in:
Kubernetes Prow Robot 2020-02-21 14:08:48 -08:00 committed by GitHub
commit 7e7976b9ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,8 @@ class Watch(object):
js = json.loads(data)
except ValueError:
return data
if not (isinstance(js, dict) and 'object' in js):
return data
js['raw_object'] = js['object']
if return_type:
obj = SimpleNamespace(data=json.dumps(js['raw_object']))