import tempfile
import shutil
import sys
+import socket
import threading
import urllib
import urllib2
import datetime, time
import _strptime # Needed for python threading bug
- u = urllib2.urlopen(self.url)
+ u = urllib2.urlopen(self.url, timeout=10)
return time.mktime(datetime.datetime.strptime( \
u.info().getheaders("Last-Modified")[0],
"%a, %d %b %Y %X GMT").timetuple())
else:
try:
t = self._getremotetime()
- except urllib2.URLError:
+ except (urllib2.URLError, socket.timeout):
# Problem checking the server, use the old files.
log.test_log.debug("Could not contact server. Binaries may be old.")
return
else:
try:
t = self._getremotetime()
- except urllib2.URLError:
+ except (urllib2.URLError, socket.timeout):
# Problem checking the server, use the old files.
log.test_log.debug("Could not contact server. "
"Binaries may be old.")