summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 15:49:45 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-09 15:49:45 -0300
commit5a87a51c119395cd12633d02a3c9558c32a73a43 (patch)
tree30a6f792c9ed148e6cdbf587ff317d6a6891cffc
parent323b37bedadbef313a513ded818e326b6e5f2dcd (diff)
downloadpyside-5a87a51c119395cd12633d02a3c9558c32a73a43.tar.gz
pyside-5a87a51c119395cd12633d02a3c9558c32a73a43.tar.xz
pyside-5a87a51c119395cd12633d02a3c9558c32a73a43.zip
Updated http server used on tests to keep trying until get a free address.
-rw-r--r--tests/util/httpd.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/util/httpd.py b/tests/util/httpd.py
index efaf588..723a5dc 100644
--- a/tests/util/httpd.py
+++ b/tests/util/httpd.py
@@ -124,11 +124,12 @@ class TestServer(threading.Thread):
else:
handle = TestHandler
- try:
- self.httpd = CompatTCPServer(('' , self._port), handle)
- except:
- self._port = self._port + random.randint(1, 100)
- self.httpd = CompatTCPServer(('' , self._port), handle)
+ while True:
+ try:
+ self.httpd = CompatTCPServer(('' , self._port), handle)
+ break
+ except:
+ self._port = self._port + random.randint(1, 100)
def port(self):
return self._port