| 1637 | return (basestate, self._tzinfo) |
| 1638 | |
| 1639 | def __setstate(self, string, tzinfo): |
| 1640 | if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class): |
| 1641 | raise TypeError("bad tzinfo state arg") |
| 1642 | h, self._minute, self._second, us1, us2, us3 = string |
| 1643 | if h > 127: |
| 1644 | self._fold = 1 |
| 1645 | self._hour = h - 128 |
| 1646 | else: |
| 1647 | self._fold = 0 |
| 1648 | self._hour = h |
| 1649 | self._microsecond = (((us1 << 8) | us2) << 8) | us3 |
| 1650 | self._tzinfo = tzinfo |
| 1651 | |
| 1652 | def __reduce_ex__(self, protocol): |
| 1653 | return (self.__class__, self._getstate(protocol)) |