Fix code depending on exception unpacking.

This commit is contained in:
Guido van Rossum 2007-05-09 23:43:17 +00:00
parent 7fe7d1ac4d
commit e2c8f2d581
1 changed files with 1 additions and 1 deletions

View File

@ -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__)