Skip to content

Commit

Permalink
Merge pull request benoitc#1219 from benoitc/fix/socket-destroy-recur…
Browse files Browse the repository at this point in the history
…sion

fix infinite recursion when destroying sockets
  • Loading branch information
tilgovi committed Mar 13, 2016
2 parents 8e2415a + 0e65c5a commit 512bb32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gunicorn/sock.py
Expand Up @@ -54,11 +54,15 @@ def bind(self, sock):
sock.bind(self.cfg_addr)

def close(self):
if self.sock is None:
return

try:
self.sock.close()
except socket.error as e:
self.log.info("Error while closing socket %s", str(e))
del self.sock

self.sock = None


class TCPSocket(BaseSocket):
Expand Down

0 comments on commit 512bb32

Please sign in to comment.