Skip to content

Commit 0095bcf

Browse files
committed
Made tweaks suggested at benoitc/gunicorn/benoitc#1131
1 parent 9aa1d41 commit 0095bcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gunicorn/sock.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def set_options(self, sock, bound=False):
4040
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
4141
try:
4242
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
43-
except socket.error as ex:
44-
if ex.errno == 92:
43+
except socket.error as e:
44+
if e.errno == errno.ENOPROTOOPT:
4545
self.log.warning('SO_REUSEPORT socket option not supported.')
4646
if not bound:
4747
self.bind(sock)

0 commit comments

Comments
 (0)