diff --git a/doc/source/whatsnew/v0.19.2.txt b/doc/source/whatsnew/v0.19.2.txt index 499a7e734f616..8ec4a35b0da17 100644 --- a/doc/source/whatsnew/v0.19.2.txt +++ b/doc/source/whatsnew/v0.19.2.txt @@ -42,8 +42,9 @@ Bug Fixes - Compat with python 3.6 for pickling of some offsets (:issue:`14685`) -- Compat with python 3.6 for some indexing exception types (:issue:`14684`) +- Compat with python 3.6 for some indexing exception types (:issue:`14684`, :issue:`14689`) - Compat with python 3.6 for deprecation warnings in the test suite (:issue:`14681`) +- Compat with python 3.6 for Timestamp pickles (:issue:`14689`) diff --git a/pandas/tslib.pyx b/pandas/tslib.pyx index e05363de2983a..acc0e45562cf2 100644 --- a/pandas/tslib.pyx +++ b/pandas/tslib.pyx @@ -1105,6 +1105,12 @@ cdef class _Timestamp(datetime): self._assert_tzawareness_compat(other) return _cmp_scalar(self.value, ots.value, op) + def __reduce_ex__(self, protocol): + # python 3.6 compat + # http://bugs.python.org/issue28730 + # now __reduce_ex__ is defined and higher priority than __reduce__ + return self.__reduce__() + def __repr__(self): stamp = self._repr_base zone = None diff --git a/pandas/types/common.py b/pandas/types/common.py index 691e15610867b..754ff80924c07 100644 --- a/pandas/types/common.py +++ b/pandas/types/common.py @@ -196,8 +196,8 @@ def _is_unorderable_exception(e): These are different error message for PY>=3<=3.5 and PY>=3.6 """ if PY36: - return ("'>' not supported between instances " - "of 'str' and 'int'" in str(e)) + return "'>' not supported between instances of" in str(e) + elif PY3: return 'unorderable' in str(e) return False