summaryrefslogtreecommitdiffstats
path: root/Lib/SocketServer.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/SocketServer.py')
-rw-r--r--Lib/SocketServer.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py
index afb8686..23ce6fc 100644
--- a/Lib/SocketServer.py
+++ b/Lib/SocketServer.py
@@ -416,8 +416,12 @@ class TCPServer(BaseServer):
self.socket = socket.socket(self.address_family,
self.socket_type)
if bind_and_activate:
- self.server_bind()
- self.server_activate()
+ try:
+ self.server_bind()
+ self.server_activate()
+ except:
+ self.server_close()
+ raise
def server_bind(self):
"""Called by constructor to bind the socket.