Closed miracle2k closed 6 years ago
https://github.com/theelous3/asks/blob/master/asks/sessions.py#L242
I think this will not fix any r not def'd exceptions you are seeing. See https://github.com/theelous3/asks/issues/74#issuecomment-395608431 for possible reasons. Issue there is a diff scope.
I am pretty sure what was happening in my case is that
sock = await self._grab_connection(url)
caused an exception (I think it was "hostname not found") which then means that sock
is not defined, which means that if sock
does not pass.
That makes perfect sense, and nice catch.
W/o this, I sometimes see the message
NameError: r is not defined
, because it just falls through.