aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-03-06 01:10:54 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-03-06 01:10:54 +0300
commit961b7eafa462b0e127cd81c5094f79a3139774c6 (patch)
treed0265baa8d95b7b6d79797a6f89739e5a495cc0f
parentadd GitHub Actions workflow (diff)
downloadlinux-status-961b7eafa462b0e127cd81c5094f79a3139774c6.tar.gz
linux-status-961b7eafa462b0e127cd81c5094f79a3139774c6.zip
server.py: ThreadingHTTPServer is Python 3.7+ only
Diffstat (limited to '')
-rwxr-xr-xserver.py5
1 files changed, 4 insertions, 1 deletions
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: