(time_str)
| 729 | |
| 730 | |
| 731 | def _parse_transition_time(time_str): |
| 732 | match = re.fullmatch( |
| 733 | r"(?P<sign>[+-])?(?P<h>\d{1,3})(:(?P<m>\d{2})(:(?P<s>\d{2}))?)?", |
| 734 | time_str, |
| 735 | re.ASCII |
| 736 | ) |
| 737 | if match is None: |
| 738 | raise ValueError(f"Invalid time: {time_str}") |
| 739 | |
| 740 | h, m, s = (int(v or 0) for v in match.group("h", "m", "s")) |
| 741 | |
| 742 | if h > 167: |
| 743 | raise ValueError( |
| 744 | f"Hour must be in [0, 167]: {time_str}" |
| 745 | ) |
| 746 | |
| 747 | if match.group("sign") == "-": |
| 748 | h, m, s = -h, -m, -s |
| 749 | |
| 750 | return h, m, s |
| 751 | |
| 752 | |
| 753 | def _parse_tz_delta(tz_delta): |
no test coverage detected
searching dependent graphs…