File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,9 @@ def url(self):
127
127
def _get_params (self , symbol ):
128
128
# This needed because yahoo returns data shifted by 4 hours ago.
129
129
four_hours_in_seconds = 14400
130
+ # Use the difference between the unix_zero and start to prevent the bug occurrence of `OverflowError: mktime argument out of range`.
130
131
unix_zero = datetime .datetime (1970 , 1 , 1 , 8 )
131
- if self .start < unix_zero :
132
- unix_start = int ((self .start - unix_zero ).total_seconds ())
133
- else :
134
- unix_start = int (time .mktime (self .start .timetuple ()))
132
+ unix_start = int ((self .start - unix_zero ).total_seconds ())
135
133
unix_start += four_hours_in_seconds
136
134
day_end = self .end .replace (hour = 23 , minute = 59 , second = 59 )
137
135
unix_end = int (time .mktime (day_end .timetuple ()))
You can’t perform that action at this time.
0 commit comments