Ignore type-errors related to attr.asdict

This commit is contained in:
Bruno Oliveira 2022-08-26 09:57:18 -03:00
parent 71b79fcda5
commit aae93d6127
1 changed files with 3 additions and 3 deletions

View File

@ -455,7 +455,7 @@ def _report_to_json(report: BaseReport) -> Dict[str, Any]:
def serialize_repr_entry(
entry: Union[ReprEntry, ReprEntryNative]
) -> Dict[str, Any]:
data = attr.asdict(entry)
data = attr.asdict(entry) # type:ignore[arg-type]
for key, value in data.items():
if hasattr(value, "__dict__"):
data[key] = attr.asdict(value)
@ -463,7 +463,7 @@ def _report_to_json(report: BaseReport) -> Dict[str, Any]:
return entry_data
def serialize_repr_traceback(reprtraceback: ReprTraceback) -> Dict[str, Any]:
result = attr.asdict(reprtraceback)
result = attr.asdict(reprtraceback) # type:ignore[arg-type]
result["reprentries"] = [
serialize_repr_entry(x) for x in reprtraceback.reprentries
]
@ -473,7 +473,7 @@ def _report_to_json(report: BaseReport) -> Dict[str, Any]:
reprcrash: Optional[ReprFileLocation],
) -> Optional[Dict[str, Any]]:
if reprcrash is not None:
return attr.asdict(reprcrash)
return attr.asdict(reprcrash) # type:ignore[arg-type]
else:
return None