diff options
| author | Sergey Shepelev <temotor@gmail.com> | 2017-07-29 00:07:17 +0300 |
|---|---|---|
| committer | Sergey Shepelev <temotor@gmail.com> | 2017-07-29 00:07:31 +0300 |
| commit | f1b63abd6db186c978077499f9670600da599d1a (patch) | |
| tree | a8813860970c42027048db7c2837b67648462131 | |
| parent | 9e8c431fe387f37669d8a42f3bb70e4077dea571 (diff) | |
| download | eventlet-f1b63abd6db186c978077499f9670600da599d1a.tar.gz | |
convenience: (SO_REUSEPORT) socket.error is not OSError on Python 2; Thanks to JacoFourie@githubreuseport-380
https://github.com/eventlet/eventlet/issues/380
| -rw-r--r-- | eventlet/convenience.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/eventlet/convenience.py b/eventlet/convenience.py index 7453ff8..9d96a26 100644 --- a/eventlet/convenience.py +++ b/eventlet/convenience.py @@ -62,7 +62,8 @@ def listen(addr, family=socket.AF_INET, backlog=50, reuse_addr=True, reuse_port= # NOTE(zhengwei): linux kernel >= 3.9 try: sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) - except OSError as ex: + # OSError is enough on Python 3+ + except (OSError, socket.error) as ex: if support.get_errno(ex) in (22, 92): # A famous platform defines unsupported socket option. # https://github.com/eventlet/eventlet/issues/380 |
