Skip to content

Commit ab595f6

Browse files
committed
Condition content from get_graph_reference if PY3.
This is super annoying and I wasn’t able to see a simple way of getting `six` to help us out… This is ugly but it should work.
1 parent 6ef551b commit ab595f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plotly/graph_reference.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def get_graph_reference():
5353
"the schema from '{}' failed.".format(graph_reference_url)
5454
)
5555
else:
56-
data = json.loads(str(response.content)) # str for PY2/3 compat.
56+
if six.PY3:
57+
content = str(response.content, encoding='utf-8')
58+
else:
59+
content = response.content
60+
data = json.loads(content)
5761
if data['modified']:
5862
graph_reference = data['schema']
5963

0 commit comments

Comments
 (0)