(headers: object)
| 11 | |
| 12 | |
| 13 | def _iter_header_items(headers: object) -> list[tuple[object, object]]: |
| 14 | if isinstance(headers, Mapping): |
| 15 | mapping_headers = cast("Mapping[object, object]", headers) |
| 16 | return list(mapping_headers.items()) |
| 17 | |
| 18 | items = getattr(headers, "items", None) |
| 19 | if callable(items): |
| 20 | with contextlib.suppress(Exception): |
| 21 | return list(cast("Iterable[tuple[object, object]]", items())) |
| 22 | |
| 23 | return [] |
| 24 | |
| 25 | |
| 26 | def _iter_event_header_pairs( |
no test coverage detected