Remove nio <0.11 asdict workaround

Mirage 0.5.0 requires nio 0.11+
This commit is contained in:
miruka 2020-05-14 14:47:32 -04:00
parent 4546a2f88c
commit bbb74b7b90

View File

@ -266,12 +266,7 @@ class Event(ModelItem):
def serialize_field(self, field: str) -> Any:
if field == "source":
try:
as_dict = nio.attr.asdict # nio < 0.11
except AttributeError:
as_dict = asdict
source_dict = as_dict(self.source) if self.source else {}
source_dict = asdict(self.source) if self.source else {}
return json.dumps(source_dict)
return super().serialize_field(field)