Parse a wire-format timestamp into ``datetime``. Accepts either an ISO-8601 string (server-sent JSON) or an existing ``datetime`` (round-tripped from a previous parse). Returns the value as-is if it's already a ``datetime``.
(value: Any)
| 884 | |
| 885 | |
| 886 | def _parse_session_timestamp(value: Any) -> datetime: |
| 887 | """Parse a wire-format timestamp into ``datetime``. |
| 888 | |
| 889 | Accepts either an ISO-8601 string (server-sent JSON) or an existing |
| 890 | ``datetime`` (round-tripped from a previous parse). Returns the value |
| 891 | as-is if it's already a ``datetime``. |
| 892 | """ |
| 893 | if isinstance(value, datetime): |
| 894 | return value |
| 895 | return from_datetime(value) |
| 896 | |
| 897 | |
| 898 | # ============================================================================ |
no test coverage detected
searching dependent graphs…