Adjust code to avoid ambiguous Unicode

This commit is contained in:
Edward Betts 2023-09-29 12:24:32 +01:00
parent f80fb70bb8
commit a163f68d59

View file

@ -101,7 +101,9 @@ class Index:
assert tag[0] is not None and tag[1] is not None assert tag[0] is not None and tag[1] is not None
self.price = decimal.Decimal(tag[0].text_content().replace(",", "").strip()) self.price = decimal.Decimal(tag[0].text_content().replace(",", "").strip())
percent_change_str = tag[1][0].text_content().strip().replace("", "-") percent_change_str = tag[1][0].text_content().strip()
percent_change_str = percent_change_str.replace("\N{MINUS SIGN}", "-")
self.day_change = decimal.Decimal(percent_change_str) self.day_change = decimal.Decimal(percent_change_str)
m = re_percent_change.match(tag[1][1].text_content()) m = re_percent_change.match(tag[1][1].text_content())
assert m assert m