Skip to content

Commit 18865de

Browse files
committed
Set HTTPServer class variable allow_reuse_address to 1, so restarting
the server after it died doesn't require a wait period.
1 parent e3c7a5f commit 18865de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/BaseHTTPServer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787

8888
class HTTPServer(SocketServer.TCPServer):
8989

90+
allow_reuse_address = 1 # Seems to make sense in testing environment
91+
9092
def server_bind(self):
9193
"""Override server_bind to store the server name."""
9294
SocketServer.TCPServer.server_bind(self)

0 commit comments

Comments
 (0)