Browse Source
fixed support for python versions prior to 3.6 ... (#870)
... which do not support a context manager in the socketserver
pull/874/head
Hamish Coleman
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
5 deletions
-
scripts/n2n-httpd
|
@ -521,7 +521,8 @@ 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: |
|
|
|
|
|
|
|
|
httpd = socketserver.TCPServer(("", args.port), handler) |
|
|
try: |
|
|
try: |
|
|
httpd.serve_forever() |
|
|
httpd.serve_forever() |
|
|
except KeyboardInterrupt: |
|
|
except KeyboardInterrupt: |
|
|