Fix for Python 3.5, refs #435

pull/437/head
Simon Willison 2019-04-21 11:20:20 -07:00
rodzic 9d73e3c8bd
commit 11b352b4d5
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -738,7 +738,7 @@ class Datasette:
extra_html = "<pre>{}</pre></body>".format(extra).encode("utf8")
response.body = response.body.replace(b"</body>", extra_html)
elif "json" in response.content_type and response.body.startswith(b"{"):
data = json.loads(response.body)
data = json.loads(response.body.decode("utf8"))
if "_traces" not in data:
data["_traces"] = {
"num_traces": len(traces),