Closed Tianhao-Gu closed 5 years ago
Would a
with
work better here?
@MrCreosote using with requests
. There are two requests in try-except block. I think using response.close()
is more clean.
with
ensures that whatever happens in the block, the socket is closed. If you don't use with
and there's an error in the block prior to the close call you'll leak sockets
@MrCreosote Sure. Updated all requests
using with
.
LGTM
Would a
with
work better here?