Fix "TypeError: 'OSError' object is not subscriptable" in py3

This commit is contained in:
JM Fernández 2017-03-28 09:44:19 +02:00 committed by Berker Peksag
parent 328e509260
commit 68260c6883

View File

@ -43,7 +43,7 @@ class BaseSocket(object):
try:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
except socket.error as err:
if err[0] not in (errno.ENOPROTOOPT, errno.EINVAL):
if err.errno not in (errno.ENOPROTOOPT, errno.EINVAL):
raise
if not bound:
self.bind(sock)