summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-03-24 23:58:40 +0200
committerLars Wirzenius <liw@liw.fi>2018-03-24 23:58:40 +0200
commitf8b51c82113f1e6b22dbc99659784e2bb3ec029c (patch)
tree1d73ed5a8997e5dd609c547f3dc6cb900dc2ad8f
parentca24a4adce869234dc510443d8b435c4a74f8207 (diff)
downloadick2-f8b51c82113f1e6b22dbc99659784e2bb3ec029c.tar.gz
Fix: lib.py wait_for_port to actually work
Previously, if the timing was just right, the function would try to connect to the port before gunicorn had opened it, and handled the resulting excption badly. Should now handle it correctly.
-rw-r--r--yarns/lib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/yarns/lib.py b/yarns/lib.py
index 0914b00..d57e11f 100644
--- a/yarns/lib.py
+++ b/yarns/lib.py
@@ -59,6 +59,8 @@ def wait_for_port(port):
try:
s = socket.socket()
s.connect(('127.0.0.1', port))
+ except socket.error:
+ time.sleep(0.1)
except OSError as e:
raise
else: