| 2361 | return (basestate, self._tzinfo) |
| 2362 | |
| 2363 | def __setstate(self, string, tzinfo): |
| 2364 | if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class): |
| 2365 | raise TypeError("bad tzinfo state arg") |
| 2366 | (yhi, ylo, m, self._day, self._hour, |
| 2367 | self._minute, self._second, us1, us2, us3) = string |
| 2368 | if m > 127: |
| 2369 | self._fold = 1 |
| 2370 | self._month = m - 128 |
| 2371 | else: |
| 2372 | self._fold = 0 |
| 2373 | self._month = m |
| 2374 | self._year = yhi * 256 + ylo |
| 2375 | self._microsecond = (((us1 << 8) | us2) << 8) | us3 |
| 2376 | self._tzinfo = tzinfo |
| 2377 | |
| 2378 | def __reduce_ex__(self, protocol): |
| 2379 | return (self.__class__, self._getstate(protocol)) |