diff --git a/maths/matrix_exponentiation.py b/maths/matrix_exponentiation.py index 15b0c96e0f07..5d0ef8e8aa76 100644 --- a/maths/matrix_exponentiation.py +++ b/maths/matrix_exponentiation.py @@ -1,5 +1,7 @@ """Matrix Exponentiation""" +from __future__ import annotations + import timeit """ diff --git a/web_programming/fetch_well_rx_price.py b/web_programming/fetch_well_rx_price.py index 680d7444bd1c..cf15d5e13cbe 100644 --- a/web_programming/fetch_well_rx_price.py +++ b/web_programming/fetch_well_rx_price.py @@ -67,7 +67,9 @@ def fetch_pharmacy_and_price_list(drug_name: str, zip_code: str) -> list | None: return pharmacy_price_list - except httpx.HTTPError, ValueError: + except httpx.HTTPError: + return None + except ValueError: return None diff --git a/web_programming/instagram_crawler.py b/web_programming/instagram_crawler.py index 0b91db01ca09..731b2b85642b 100644 --- a/web_programming/instagram_crawler.py +++ b/web_programming/instagram_crawler.py @@ -53,7 +53,9 @@ def get_json(self) -> dict: scripts = BeautifulSoup(html, "html.parser").find_all("script") try: return extract_user_profile(scripts[4]) - except json.decoder.JSONDecodeError, KeyError: + except json.decoder.JSONDecodeError: + return extract_user_profile(scripts[3]) + except KeyError: return extract_user_profile(scripts[3]) def __repr__(self) -> str: