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
parent
commit
e727304681
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      scripts/n2n-httpd

3
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:

Loading…
Cancel
Save