File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1005,6 +1005,12 @@ def _get_transitions(tz):
1005
1005
"""
1006
1006
Get UTC times of DST transitions
1007
1007
"""
1008
+ try :
1009
+ # tzoffset not hashable in Python 3
1010
+ hash (tz)
1011
+ except TypeError :
1012
+ return np.array([NPY_NAT + 1 ], dtype = np.int64)
1013
+
1008
1014
if tz not in trans_cache:
1009
1015
if hasattr (tz, ' _utc_transition_times' ):
1010
1016
arr = np.array(tz._utc_transition_times, dtype = ' M8[ns]' )
@@ -1018,6 +1024,13 @@ def _get_deltas(tz):
1018
1024
"""
1019
1025
Get UTC offsets in microseconds corresponding to DST transitions
1020
1026
"""
1027
+ try :
1028
+ # tzoffset not hashable in Python 3
1029
+ hash (tz)
1030
+ except TypeError :
1031
+ num = int (total_seconds(_get_utcoffset(tz))) * 1000000000
1032
+ return np.array([num], dtype = np.int64)
1033
+
1021
1034
if tz not in utc_offset_cache:
1022
1035
if hasattr (tz, ' _utc_transition_times' ):
1023
1036
utc_offset_cache[tz] = _unbox_utcoffsets(tz._transition_info)
You can’t perform that action at this time.
0 commit comments