From 5f835b34e78357a81f7a201b23144951bf2f6ed7 Mon Sep 17 00:00:00 2001 From: Arnav Garg Date: Wed, 24 Jun 2026 18:03:02 +0530 Subject: [PATCH 1/2] Fix SyntaxError and NameError in multiple files --- maths/matrix_exponentiation.py | 2 ++ web_programming/fetch_well_rx_price.py | 2 +- web_programming/instagram_crawler.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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..e34a89c19cc8 100644 --- a/web_programming/fetch_well_rx_price.py +++ b/web_programming/fetch_well_rx_price.py @@ -67,7 +67,7 @@ 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, ValueError): return None diff --git a/web_programming/instagram_crawler.py b/web_programming/instagram_crawler.py index 0b91db01ca09..68271c1c4643 100644 --- a/web_programming/instagram_crawler.py +++ b/web_programming/instagram_crawler.py @@ -53,7 +53,7 @@ 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, KeyError): return extract_user_profile(scripts[3]) def __repr__(self) -> str: From 740e6876c418633a803992c953d4e28ffdd9e375 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 24 Jun 2026 12:41:09 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- web_programming/fetch_well_rx_price.py | 2 +- web_programming/instagram_crawler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web_programming/fetch_well_rx_price.py b/web_programming/fetch_well_rx_price.py index e34a89c19cc8..680d7444bd1c 100644 --- a/web_programming/fetch_well_rx_price.py +++ b/web_programming/fetch_well_rx_price.py @@ -67,7 +67,7 @@ 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, ValueError: return None diff --git a/web_programming/instagram_crawler.py b/web_programming/instagram_crawler.py index 68271c1c4643..0b91db01ca09 100644 --- a/web_programming/instagram_crawler.py +++ b/web_programming/instagram_crawler.py @@ -53,7 +53,7 @@ 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, KeyError: return extract_user_profile(scripts[3]) def __repr__(self) -> str: