Skip to content

Commit

Permalink
Merge pull request #1841 from Rogach/pr/dont-disable-global-logging
Browse files Browse the repository at this point in the history
do not disable app-wide logging in quote.py (fixes #1829)
  • Loading branch information
ValueRaider authored Jan 28, 2024
2 parents 75297c0 + 212a798 commit 6b8a4a5
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions yfinance/scrapers/quote.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import datetime
import json
import logging
import warnings
from collections.abc import MutableMapping

Expand Down Expand Up @@ -182,10 +181,7 @@ def toJSON(self, indent=4):

def _get_1y_prices(self, fullDaysOnly=False):
if self._prices_1y is None:
# Temporarily disable error printing
logging.disable(logging.CRITICAL)
self._prices_1y = self._tkr.history(period="380d", auto_adjust=False, keepna=True, proxy=self.proxy)
logging.disable(logging.NOTSET)
self._md = self._tkr.get_history_metadata(proxy=self.proxy)
try:
ctp = self._md["currentTradingPeriod"]
Expand All @@ -211,18 +207,12 @@ def _get_1y_prices(self, fullDaysOnly=False):

def _get_1wk_1h_prepost_prices(self):
if self._prices_1wk_1h_prepost is None:
# Temporarily disable error printing
logging.disable(logging.CRITICAL)
self._prices_1wk_1h_prepost = self._tkr.history(period="1wk", interval="1h", auto_adjust=False, prepost=True, proxy=self.proxy)
logging.disable(logging.NOTSET)
return self._prices_1wk_1h_prepost

def _get_1wk_1h_reg_prices(self):
if self._prices_1wk_1h_reg is None:
# Temporarily disable error printing
logging.disable(logging.CRITICAL)
self._prices_1wk_1h_reg = self._tkr.history(period="1wk", interval="1h", auto_adjust=False, prepost=False, proxy=self.proxy)
logging.disable(logging.NOTSET)
return self._prices_1wk_1h_reg

def _get_exchange_metadata(self):
Expand Down

0 comments on commit 6b8a4a5

Please sign in to comment.