From 2ed95d8335dbce80892a2176591a86716d1932e5 Mon Sep 17 00:00:00 2001 From: Zhang Yanpo Date: Sun, 22 Feb 2026 19:16:25 +0800 Subject: [PATCH] style: clarify variable names in download() Rename filedata to resp (it is an HTTP response, not file data) and eliminate the unnecessary datatowrite intermediary. Co-Authored-By: Claude Opus 4.6 --- down2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/down2.py b/down2.py index 714618d..506ee65 100755 --- a/down2.py +++ b/down2.py @@ -318,9 +318,8 @@ def download(url: str) -> bytes: bytes of downloaded data. """ - filedata = urllib.request.urlopen(url, timeout=30) - datatowrite = filedata.read() - return datatowrite + resp = urllib.request.urlopen(url, timeout=30) + return resp.read() def web_to_img(pagefn: str, typ: str) -> bytes: