From e7273046814cfdad6e68ad149879129ef3f4bd04 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 24 Oct 2021 12:31:48 +0100 Subject: [PATCH] fixed support for python versions prior to 3.6 ... (#870) ... which do not support a context manager in the socketserver --- scripts/n2n-httpd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/n2n-httpd b/scripts/n2n-httpd index e063fb1..662d9b6 100755 --- a/scripts/n2n-httpd +++ b/scripts/n2n-httpd @@ -521,11 +521,12 @@ def main(): socketserver.TCPServer.allow_reuse_address = True handler = functools.partial(SimpleHandler, rpc, snrpc) - with socketserver.TCPServer(("", args.port), handler) as httpd: - try: - httpd.serve_forever() - except KeyboardInterrupt: - return + + httpd = socketserver.TCPServer(("", args.port), handler) + try: + httpd.serve_forever() + except KeyboardInterrupt: + return if __name__ == '__main__':