From afe6ec17bdb14f588a3e8fe22457d25bf6372e51 Mon Sep 17 00:00:00 2001 From: Arnav Garg Date: Thu, 25 Jun 2026 11:10:52 +0530 Subject: [PATCH 1/2] Fix SyntaxError in exception handling for Python 3 --- 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 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 1ea4e7618dab7b367d7156f9499761685cd23e74 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2026 05:42:10 +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: