From 884190008cb46547670cbc3ba8457c9a59ea99bf Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Sat, 13 Jul 2024 17:58:32 +0300 Subject: [PATCH] Fix S113 warning from ruff --- examples/download_html.py | 2 +- examples/download_image.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/download_html.py b/examples/download_html.py index e42b85b..c94f0a2 100755 --- a/examples/download_html.py +++ b/examples/download_html.py @@ -12,7 +12,7 @@ async def load_data(): text.insert(tk.END, "Loading...") button.config(state=tk.DISABLED) - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(timeout=30) as client: response = await client.get("https://python.org", follow_redirects=True) text.delete(1.0, tk.END) diff --git a/examples/download_image.py b/examples/download_image.py index 001b7af..f020dbb 100755 --- a/examples/download_image.py +++ b/examples/download_image.py @@ -12,7 +12,7 @@ async def load_image(url): button.config(state=tk.DISABLED) label.config(text="Loading...", image="") - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(timeout=30) as client: response = await client.get(url, follow_redirects=True) if response.status_code != 200: label.config(text=f"HTTP error {response.status_code}")