Fix some fucking shit with importing wx

This commit is contained in:
2026-02-28 21:16:26 +01:00
parent 5c01ecb2d1
commit b1c9b57ef7
7 changed files with 33 additions and 27 deletions

View File

@@ -394,10 +394,14 @@ def _run_http_server(port: int, savepath: str | None) -> None:
self.wfile.write(str(e).encode("utf-8"))
return
except Exception as e:
import traceback
tb = traceback.format_exc()
sys.stderr.write(tb)
sys.stderr.flush()
self.send_response(500)
self.send_header("Content-Type", "text/plain; charset=utf-8")
self.end_headers()
self.wfile.write(str(e).encode("utf-8"))
self.wfile.write((str(e) + "\n\n" + tb).encode("utf-8"))
return
self.send_response(200)
self.send_header("Content-Type", "application/json; charset=utf-8")