mirror of
https://github.com/curl/curl.git
synced 2025-09-16 17:12:43 +03:00
parent
5f8351aea3
commit
00ea0aaf46
|
@ -66,9 +66,9 @@ def telnetserver(options):
|
|||
|
||||
# Need to set the allow_reuse on the class, not on the instance.
|
||||
socketserver.TCPServer.allow_reuse_address = True
|
||||
server = socketserver.TCPServer(local_bind, NegotiatingTelnetHandler)
|
||||
server.serve_forever()
|
||||
|
||||
with socketserver.TCPServer(local_bind, NegotiatingTelnetHandler) as server:
|
||||
server.serve_forever()
|
||||
# leaving `with` calls server.close() automatically
|
||||
return ScriptRC.SUCCESS
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user