Commit 32f6b26d authored by Denis Bilenko's avatar Denis Bilenko

baseserver: include address we tried to bind on in the error message

--HG--
extra : transplant_source : %F7c8%40%E6%E5m%C4%25%8F%29%A8E%82%DF%B6c%F5%9A%A7
parent 337591a3
......@@ -202,7 +202,13 @@ def _tcp_listener(address, backlog=50, reuse_addr=None):
sock = _socket.socket()
if reuse_addr is not None:
sock.setsockopt(_socket.SOL_SOCKET, _socket.SO_REUSEADDR, reuse_addr)
sock.bind(address)
try:
sock.bind(address)
except _socket.error, ex:
strerror = getattr(ex, 'strerror', None)
if strerror is not None:
ex.strerror = strerror + ': ' + repr(address)
raise
sock.listen(backlog)
sock.setblocking(0)
return sock
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment