Fixing some Python 3.5 vs 3.7 compatibility issues

This commit is contained in:
John Donaldson 2019-04-29 20:31:16 +01:00
parent 96835d6504
commit e330990211
2 changed files with 5 additions and 2 deletions

View File

@ -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" ]

View File

@ -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):