Commit f8f952f4 authored by Denis Bilenko's avatar Denis Bilenko

test_support.py: fix bug in bind_port() that caused it to stop trying after the first port.

parent 19776f49
......@@ -173,8 +173,7 @@ def bind_port(sock, host='', preferred_port=54321):
port = sock.getsockname()[1]
return port
except socket.error:
err = sys.exc_info()[1]
if err != errno.EADDRINUSE:
if sys.exc_info()[1].args[0] != errno.EADDRINUSE:
raise
print >>sys.__stderr__, \
' WARNING: failed to listen on port %d, trying another' % port
......
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