Skip to content

Commit a24c0e1

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

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
@@ -196,7 +196,7 @@ def history(self, period="1mo", interval="1d",
196196
get_fn = self._data.get
197197
if end is not None:
198198
end_dt = _pd.Timestamp(end, unit='s').tz_localize("UTC")
199-
dt_now = end_dt.tzinfo.localize(_datetime.datetime.utcnow())
199+
dt_now = _pd.Timestamp.utcnow()
200200
data_delay = _datetime.timedelta(minutes=30)
201201
if end_dt+data_delay <= dt_now:
202202
# Date range in past so safe to fetch through cache:

0 commit comments

Comments
 (0)