Skip to content

Commit d70a1f4

Browse files
committed
Fix python 3 .content issue. (can’t loads)
1 parent 6d23a55 commit d70a1f4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

plotly/tests/test_core/test_graph_reference/test_graph_reference.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from unittest import TestCase
1111

1212
import requests
13+
import six
1314
from nose.plugins.attrib import attr
1415

1516
from plotly import files, graph_reference as gr, tools, utils
@@ -64,7 +65,11 @@ def test_default_schema_is_up_to_date(self):
6465
graph_reference_url = '{}{}?sha1'.format(api_domain,
6566
gr.GRAPH_REFERENCE_PATH)
6667
response = requests.get(graph_reference_url)
67-
schema = json.loads(response.content)['schema']
68+
if six.PY3:
69+
content = str(response.content, encoding='utf-8')
70+
else:
71+
content = response.content
72+
schema = json.loads(content)['schema']
6873

6974
path = os.path.join('graph_reference', 'default-schema.json')
7075
s = resource_string('plotly', path).decode('utf-8')

0 commit comments

Comments
 (0)