(tzinfo: datetime.tzinfo | None)
| 321 | |
| 322 | |
| 323 | def _get_tzinfo_name(tzinfo: datetime.tzinfo | None) -> str | None: |
| 324 | if tzinfo is None: |
| 325 | return None |
| 326 | |
| 327 | if hasattr(tzinfo, "key"): |
| 328 | # zoneinfo timezone |
| 329 | return cast("zoneinfo.ZoneInfo", tzinfo).key |
| 330 | elif hasattr(tzinfo, "name"): |
| 331 | # Pendulum timezone |
| 332 | return cast("Timezone", tzinfo).name |
| 333 | elif hasattr(tzinfo, "zone"): |
| 334 | # pytz timezone |
| 335 | return tzinfo.zone # type: ignore[no-any-return] |
| 336 | |
| 337 | return None |
no outgoing calls
no test coverage detected
searching dependent graphs…