Skip to content

Commit cc25851

Browse files
committed
fix tzinfo missing attribute
tzinfo does not have a localize attribute so it is replaced with timestamp in UTC
1 parent 1e941fc commit cc25851

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yfinance/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def history(self, period="1mo", interval="1d",
204204
get_fn = self._data.get
205205
if end is not None:
206206
end_dt = _pd.Timestamp(end, unit='s').tz_localize("UTC")
207-
dt_now = end_dt.tzinfo.localize(_datetime.datetime.utcnow())
207+
dt_now = _pd.Timestamp.utcnow()
208208
data_delay = _datetime.timedelta(minutes=30)
209209
if end_dt+data_delay <= dt_now:
210210
# Date range in past so safe to fetch through cache:

0 commit comments

Comments
 (0)