From e91b41f71e0200a6f1ca45459ec7ce86c8434b39 Mon Sep 17 00:00:00 2001 From: Mark Klara Date: Mon, 1 Jul 2024 12:55:06 -0700 Subject: [PATCH] Fix py warning =============================== warnings summary =============================== src/Active/YahooFinance.py:18 /home/runner/work/IsThisStockGood/IsThisStockGood/src/Active/YahooFinance.py:18: DeprecationWarning: invalid escape sequence '\d' match = re.match('(\d+(\.\d+)?%)', text) --- src/Active/YahooFinance.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Active/YahooFinance.py b/src/Active/YahooFinance.py index f654d5c..be5ce4b 100644 --- a/src/Active/YahooFinance.py +++ b/src/Active/YahooFinance.py @@ -15,7 +15,7 @@ def _construct_url(cls, ticker_symbol): def _isPercentage(cls, text): if not isinstance(text, str): return False - match = re.match('(\d+(\.\d+)?%)', text) + match = re.match(r'(\d+(\.\d+)?%)', text) return match != None @classmethod @@ -41,4 +41,4 @@ def parse_analyst_five_year_growth_rate(self, content): if text == 'Next 5 Years (per annum)': percentage = YahooFinanceAnalysis._parseNextPercentage(tree_iterator) self.five_year_growth_rate = percentage.rstrip("%") if percentage else None - return True if self.five_year_growth_rate else False \ No newline at end of file + return True if self.five_year_growth_rate else False