From 961b7eafa462b0e127cd81c5094f79a3139774c6 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 6 Mar 2021 01:10:54 +0300 Subject: server.py: ThreadingHTTPServer is Python 3.7+ only --- server.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 6052b06..1b64766 100755 --- a/server.py +++ b/server.py @@ -54,7 +54,10 @@ def main(args=None): os.chdir(script_dir()) args = parse_args(args) addr = ('', args.port) - httpd = http.server.ThreadingHTTPServer(addr, RequestHandler) + server = http.server.HTTPServer + if sys.version_info >= (3, 7): + server = http.server.ThreadingHTTPServer + httpd = server(addr, RequestHandler) try: httpd.serve_forever() except KeyboardInterrupt: -- cgit v1.2.3