| 2252 | return (basestate, self._tzinfo) |
| 2253 | |
| 2254 | def __setstate(self, string, tzinfo): |
| 2255 | if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class): |
| 2256 | raise TypeError("bad tzinfo state arg") |
| 2257 | (yhi, ylo, m, self._day, self._hour, |
| 2258 | self._minute, self._second, us1, us2, us3) = string |
| 2259 | if m > 127: |
| 2260 | self._fold = 1 |
| 2261 | self._month = m - 128 |
| 2262 | else: |
| 2263 | self._fold = 0 |
| 2264 | self._month = m |
| 2265 | self._year = yhi * 256 + ylo |
| 2266 | self._microsecond = (((us1 << 8) | us2) << 8) | us3 |
| 2267 | self._tzinfo = tzinfo |
| 2268 | |
| 2269 | def __reduce_ex__(self, protocol): |
| 2270 | return (self.__class__, self._getstate(protocol)) |