Skip to content

Commit 0c18ba7

Browse files
committed
Fix SyntaxError and NameError in multiple files
1 parent e3b01ec commit 0c18ba7

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

maths/matrix_exponentiation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Matrix Exponentiation"""
22

3+
from __future__ import annotations
4+
35
import timeit
46

57
"""

web_programming/fetch_well_rx_price.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def fetch_pharmacy_and_price_list(drug_name: str, zip_code: str) -> list | None:
6767

6868
return pharmacy_price_list
6969

70-
except httpx.HTTPError, ValueError:
70+
except httpx.HTTPError:
71+
return None
72+
except ValueError:
7173
return None
7274

7375

web_programming/instagram_crawler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def get_json(self) -> dict:
5353
scripts = BeautifulSoup(html, "html.parser").find_all("script")
5454
try:
5555
return extract_user_profile(scripts[4])
56-
except json.decoder.JSONDecodeError, KeyError:
56+
except json.decoder.JSONDecodeError:
57+
return extract_user_profile(scripts[3])
58+
except KeyError:
5759
return extract_user_profile(scripts[3])
5860

5961
def __repr__(self) -> str:

0 commit comments

Comments
 (0)