mirror of https://github.com/python/cpython.git
Fix code depending on exception unpacking.
This commit is contained in:
parent
7fe7d1ac4d
commit
e2c8f2d581
|
@ -106,7 +106,7 @@ def bind_port(sock, host='', preferred_port=54321):
|
|||
sock.bind((host, port))
|
||||
return port
|
||||
except socket.error as e:
|
||||
(err, msg) = e
|
||||
(err, msg) = e.args
|
||||
if err != errno.EADDRINUSE:
|
||||
raise
|
||||
print(' WARNING: failed to listen on port %d, trying another' % port, file=sys.__stderr__)
|
||||
|
|
Loading…
Reference in New Issue