Skip to content

Commit 970a195

Browse files
♻️ refactor(bib.get): Properly close HTTPResponse.
1 parent 1a70aad commit 970a195

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.bin/bib.get

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def dblp_query ( query ) :
4646
try:
4747

4848
output['time']['send'] = now()
49-
tree = html.parse(urllib.request.urlopen(url))
49+
with urllib.request.urlopen(url) as fp:
50+
tree = html.parse(fp)
5051
output['time']['receive'] = now()
5152

5253
except urllib.error.HTTPError:

0 commit comments

Comments
 (0)