Rename __json__() to asdict()

This commit is contained in:
grossmj committed 2021-04-17 23:34:28 +09:30
1 parent 44074ff7c9
commit cefab8d362
89 files changed
+286 -282

No files matched your search

+2 -2
View File
@@ -71,8 +71,8 @@ class NotificationQueue(asyncio.Queue):
Get a message as a JSON
"""
(action, msg, kwargs) = await self.get(timeout)
if hasattr(msg, "__json__"):
msg = {"action": action, "event": msg.__json__()}
if hasattr(msg, "asdict"):
msg = {"action": action, "event": msg.asdict()}
else:
msg = {"action": action, "event": msg}
msg.update(kwargs)