mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +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):
|
for i in range(count):
|
||||||
try:
|
try:
|
||||||
print('Downloading', url, flush=True)
|
print('Downloading', url, flush=True)
|
||||||
ans: bytes = urlopen(url).read()
|
with urlopen(url) as f:
|
||||||
|
ans: bytes = f.read()
|
||||||
return ans
|
return ans
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
if i >= count - 1:
|
if i >= count - 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user