Skip to content

Commit 4e240b9

Browse files
committed
explicitly close opened url
1 parent 53e2f00 commit 4e240b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/ci.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def download_with_retry(url: str | Request, count: int = 5) -> bytes:
6868
for i in range(count):
6969
try:
7070
print('Downloading', url, flush=True)
71-
ans: bytes = urlopen(url).read()
71+
with urlopen(url) as f:
72+
ans: bytes = f.read()
7273
return ans
7374
except Exception as err:
7475
if i >= count - 1:

0 commit comments

Comments
 (0)