mirror of https://github.com/dirtbags/moth.git
Fixing some Python 3.5 vs 3.7 compatibility issues
This commit is contained in:
parent
96835d6504
commit
e330990211
|
@ -16,6 +16,5 @@ COPY devel /app/
|
||||||
COPY example-puzzles /puzzles/
|
COPY example-puzzles /puzzles/
|
||||||
COPY theme /theme/
|
COPY theme /theme/
|
||||||
|
|
||||||
WORKDIR /moth/
|
|
||||||
ENTRYPOINT [ "python3", "/app/devel-server.py" ]
|
ENTRYPOINT [ "python3", "/app/devel-server.py" ]
|
||||||
CMD [ "--bind", "0.0.0.0:8080", "--puzzles", "/puzzles", "--theme", "/theme" ]
|
CMD [ "--bind", "0.0.0.0:8080", "--puzzles", "/puzzles", "--theme", "/theme" ]
|
||||||
|
|
|
@ -43,8 +43,12 @@ class MothRequestHandler(http.server.SimpleHTTPRequestHandler):
|
||||||
|
|
||||||
def __init__(self, request, client_address, server):
|
def __init__(self, request, client_address, server):
|
||||||
self.directory = str(server.args["theme_dir"])
|
self.directory = str(server.args["theme_dir"])
|
||||||
|
try:
|
||||||
|
super().__init__(request, client_address, server, directory=server.args["theme_dir"])
|
||||||
|
except TypeError:
|
||||||
super().__init__(request, client_address, server)
|
super().__init__(request, client_address, server)
|
||||||
|
|
||||||
|
|
||||||
# Backport from Python 3.7
|
# Backport from Python 3.7
|
||||||
def translate_path(self, path):
|
def translate_path(self, path):
|
||||||
# I guess we just hope that some other thread doesn't call getcwd
|
# I guess we just hope that some other thread doesn't call getcwd
|
||||||
|
|
Loading…
Reference in New Issue