| 1753 | return (basestate, self._tzinfo) |
| 1754 | |
| 1755 | def __setstate(self, string, tzinfo): |
| 1756 | if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class): |
| 1757 | raise TypeError("bad tzinfo state arg") |
| 1758 | h, self._minute, self._second, us1, us2, us3 = string |
| 1759 | if h > 127: |
| 1760 | self._fold = 1 |
| 1761 | self._hour = h - 128 |
| 1762 | else: |
| 1763 | self._fold = 0 |
| 1764 | self._hour = h |
| 1765 | self._microsecond = (((us1 << 8) | us2) << 8) | us3 |
| 1766 | self._tzinfo = tzinfo |
| 1767 | |
| 1768 | def __reduce_ex__(self, protocol): |
| 1769 | return (self.__class__, self._getstate(protocol)) |