Define a timeout for all http requests

This commit is contained in:
Némunaire 2012-07-27 18:18:13 +02:00
commit a2b273d09b
13 changed files with 12 additions and 12 deletions

View file

@ -38,7 +38,7 @@ def parseanswer(msg):
def getPage(terms):
conn = http.client.HTTPConnection("www.crisco.unicaen.fr")
conn = http.client.HTTPConnection("www.crisco.unicaen.fr", timeout=5)
try:
conn.request("GET", "/des/synonymes/%s" % quote(terms))
except socket.gaierror: