Skip to content

Commit 1fc9ae2

Browse files
committed
Enable PERF rules
1 parent 4cc91bf commit 1fc9ae2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ select = [
6767
"Q", # flake8-quotes
6868
"SIM", # flake8-simplify
6969
"FLY", # flynt
70-
# "PERF", # Perflint
70+
"PERF", # Perflint
7171

7272
# Disabled rules (uncomment to enable):
7373
# "AIR", # Airflow

src/streetview/download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def fetch_panorama_tile(
5858
try:
5959
response = requests.get(tile_info.fileurl, stream=True)
6060
return Image.open(BytesIO(response.content))
61-
except requests.ConnectionError:
61+
except requests.ConnectionError: # noqa: PERF203
6262
print("Connection error. Trying again in 2 seconds.")
6363
time.sleep(2)
6464
raise requests.ConnectionError("Max retries exceeded.")
@@ -75,7 +75,7 @@ async def fetch_panorama_tile_async(
7575
response = await async_client.get(tile_info.fileurl)
7676
return Image.open(BytesIO(response.content))
7777

78-
except httpx.RequestError as e:
78+
except httpx.RequestError as e: # noqa: PERF203
7979
print(f"Request error {e}. Trying again in 2 seconds.")
8080
await asyncio.sleep(2)
8181

0 commit comments

Comments
 (0)