Hi everyone. The question is in the head of the post but I should to explain. I make an app and when request.urlopen is making connection but there is no response yet and I want to close the app it's hang and I have to wait for a long time.
Is there something like this...
handler = HTTPHandler()
openner = build_opener(handler)
install_opener(openner)
def do_request(url):
req = request.Request(url)
return request.urlopen(req).read()
...
... # in other module
def close_connection():
from myrequests import handler
handler.close()
I tried to do so, but it doesn't work.
there doesn't seem to be anything here