mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
explicitly close opened url
This commit is contained in:
3
.github/workflows/ci.py
vendored
3
.github/workflows/ci.py
vendored
@@ -68,7 +68,8 @@ def download_with_retry(url: str | Request, count: int = 5) -> bytes:
|
||||
for i in range(count):
|
||||
try:
|
||||
print('Downloading', url, flush=True)
|
||||
ans: bytes = urlopen(url).read()
|
||||
with urlopen(url) as f:
|
||||
ans: bytes = f.read()
|
||||
return ans
|
||||
except Exception as err:
|
||||
if i >= count - 1:
|
||||
|
||||
Reference in New Issue
Block a user