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:
Hamish Coleman 2021-10-24 12:31:48 +01:00 committed by GitHub
parent 3b187b4ac8
commit e727304681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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