From e3309902117008a93c32e54548a3aef2713db7d7 Mon Sep 17 00:00:00 2001 From: John Donaldson Date: Mon, 29 Apr 2019 20:31:16 +0100 Subject: [PATCH] Fixing some Python 3.5 vs 3.7 compatibility issues --- Dockerfile.moth-devel | 1 - devel/devel-server.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile.moth-devel b/Dockerfile.moth-devel index 20c659a..6e8466a 100644 --- a/Dockerfile.moth-devel +++ b/Dockerfile.moth-devel @@ -16,6 +16,5 @@ COPY devel /app/ COPY example-puzzles /puzzles/ COPY theme /theme/ -WORKDIR /moth/ ENTRYPOINT [ "python3", "/app/devel-server.py" ] CMD [ "--bind", "0.0.0.0:8080", "--puzzles", "/puzzles", "--theme", "/theme" ] diff --git a/devel/devel-server.py b/devel/devel-server.py index 1a6167d..37fda8c 100755 --- a/devel/devel-server.py +++ b/devel/devel-server.py @@ -43,7 +43,11 @@ class MothRequestHandler(http.server.SimpleHTTPRequestHandler): def __init__(self, request, client_address, server): self.directory = str(server.args["theme_dir"]) - super().__init__(request, client_address, server) + try: + super().__init__(request, client_address, server, directory=server.args["theme_dir"]) + except TypeError: + super().__init__(request, client_address, server) + # Backport from Python 3.7 def translate_path(self, path):