mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
use args for the socket errno
This commit is contained in:
parent
f6dee213bd
commit
e12f520cea
@ -118,7 +118,7 @@ def create_socket(conf, log):
|
||||
try:
|
||||
return sock_type(conf, log, fd=fd)
|
||||
except socket.error as e:
|
||||
if e[0] == errno.ENOTCONN:
|
||||
if e.args[0] == errno.ENOTCONN:
|
||||
log.error("GUNICORN_FD should refer to an open socket.")
|
||||
else:
|
||||
raise
|
||||
@ -131,9 +131,9 @@ def create_socket(conf, log):
|
||||
try:
|
||||
return sock_type(conf, log)
|
||||
except socket.error as e:
|
||||
if e[0] == errno.EADDRINUSE:
|
||||
if e.args[0] == errno.EADDRINUSE:
|
||||
log.error("Connection in use: %s", str(addr))
|
||||
if e[0] == errno.EADDRNOTAVAIL:
|
||||
if e.args[0] == errno.EADDRNOTAVAIL:
|
||||
log.error("Invalid address: %s", str(addr))
|
||||
sys.exit(1)
|
||||
if i < 5:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user