| 1718 | return (basestate, self._tzinfo) |
| 1719 | |
| 1720 | def __setstate(self, string, tzinfo): |
| 1721 | if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class): |
| 1722 | raise TypeError("bad tzinfo state arg") |
| 1723 | h, self._minute, self._second, us1, us2, us3 = string |
| 1724 | if h > 127: |
| 1725 | self._fold = 1 |
| 1726 | self._hour = h - 128 |
| 1727 | else: |
| 1728 | self._fold = 0 |
| 1729 | self._hour = h |
| 1730 | self._microsecond = (((us1 << 8) | us2) << 8) | us3 |
| 1731 | self._tzinfo = tzinfo |
| 1732 | |
| 1733 | def __reduce_ex__(self, protocol): |
| 1734 | return (self.__class__, self._getstate(protocol)) |