Skip to content

Commit

Permalink
Fix py warning
Browse files Browse the repository at this point in the history
=============================== 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)
  • Loading branch information
mrhappyasthma authored Jul 1, 2024
1 parent ecb7b5d commit e91b41f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Active/YahooFinance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
return True if self.five_year_growth_rate else False

1 comment on commit e91b41f

@kocielnik
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that warning too, and didn't have a good idea how to fix it.

Hooray! 🥳

Please sign in to comment.