summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/gem5/fixture.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/gem5/fixture.py b/tests/gem5/fixture.py
index ddf43d17d..c22d1a334 100644
--- a/tests/gem5/fixture.py
+++ b/tests/gem5/fixture.py
@@ -43,6 +43,7 @@ import os
import tempfile
import shutil
import sys
+import socket
import threading
import urllib
import urllib2
@@ -282,7 +283,7 @@ class DownloadedProgram(UniqueFixture):
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())
@@ -294,7 +295,7 @@ class DownloadedProgram(UniqueFixture):
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
@@ -320,7 +321,7 @@ class DownloadedArchive(DownloadedProgram):
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.")