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,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__':