File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1
1
# cython: profile=False
2
-
3
2
cimport numpy as np
4
3
import numpy as np
5
4
@@ -830,6 +829,10 @@ def _get_deltas(object tz):
830
829
utc_offset_cache[tz] = _unbox_utcoffsets(tz._transition_info)
831
830
return utc_offset_cache[tz]
832
831
832
+ cdef double total_seconds(object td): # Python 2.6 compat
833
+ return ((td.microseconds + (td.seconds + td.days * 24 * 3600 ) * 10 ** 6 ) //
834
+ 10 ** 6 )
835
+
833
836
cdef ndarray _unbox_utcoffsets(object transinfo):
834
837
cdef:
835
838
Py_ssize_t i, sz
@@ -839,7 +842,7 @@ cdef ndarray _unbox_utcoffsets(object transinfo):
839
842
arr = np.empty(sz, dtype = ' i8' )
840
843
841
844
for i in range (sz):
842
- arr[i] = int (transinfo[i][0 ].total_seconds( )) * 1000000
845
+ arr[i] = int (total_seconds( transinfo[i][0 ])) * 1000000
843
846
844
847
return arr
845
848
You can’t perform that action at this time.
0 commit comments