diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-06 01:10:54 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-06 01:10:54 +0300 |
commit | 961b7eafa462b0e127cd81c5094f79a3139774c6 (patch) | |
tree | d0265baa8d95b7b6d79797a6f89739e5a495cc0f /server.py | |
parent | add GitHub Actions workflow (diff) | |
download | linux-status-961b7eafa462b0e127cd81c5094f79a3139774c6.tar.gz linux-status-961b7eafa462b0e127cd81c5094f79a3139774c6.zip |
server.py: ThreadingHTTPServer is Python 3.7+ only
Diffstat (limited to 'server.py')
-rwxr-xr-x | server.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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: |