mirror of
https://github.com/ntop/n2n.git
synced 2024-09-19 16:41:11 +02:00
fixed support for python versions prior to 3.6 ... (#870)
... which do not support a context manager in the socketserver
This commit is contained in:
parent
3b187b4ac8
commit
e727304681
|
@ -521,11 +521,12 @@ def main():
|
||||||
|
|
||||||
socketserver.TCPServer.allow_reuse_address = True
|
socketserver.TCPServer.allow_reuse_address = True
|
||||||
handler = functools.partial(SimpleHandler, rpc, snrpc)
|
handler = functools.partial(SimpleHandler, rpc, snrpc)
|
||||||
with socketserver.TCPServer(("", args.port), handler) as httpd:
|
|
||||||
try:
|
httpd = socketserver.TCPServer(("", args.port), handler)
|
||||||
httpd.serve_forever()
|
try:
|
||||||
except KeyboardInterrupt:
|
httpd.serve_forever()
|
||||||
return
|
except KeyboardInterrupt:
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user