Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Commit

Permalink
Close all server sockets on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfairley committed Oct 4, 2010
1 parent bbebd9a commit 92f5f57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mincemeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@ def run_server(self, password="", port=DEFAULT_PORT):
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.bind(("", port))
self.listen(1)
asyncore.loop()
try:
asyncore.loop()
except:
self.close_all()
raise

return self.taskmanager.results

def handle_accept(self):
Expand Down

0 comments on commit 92f5f57

Please sign in to comment.