raise TimeoutError in wait_for_server

This commit is contained in:
MinRK
2014-09-18 15:59:37 -07:00
parent a77e106488
commit 6106fecd48

View File

@@ -10,6 +10,13 @@ from tornado.log import app_log
from IPython.html.utils import url_path_join
try:
TimeoutError
except NameError:
# python < 3.3
class TimeoutError(Exception):
pass
def random_port():
"""get a single random port"""
sock = socket.socket()
@@ -34,7 +41,8 @@ def wait_for_server(ip, port, timeout=10):
)
yield gen.Task(loop.add_timeout, loop.time() + 0.1)
else:
break
return
raise TimeoutError
def auth_decorator(check_auth):
"""Make an authentication decorator