Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d70a1f4

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

File tree

Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-1
lines changed

‎plotly/tests/test_core/test_graph_reference/test_graph_reference.py

Copy file name to clipboardExpand all lines: plotly/tests/test_core/test_graph_reference/test_graph_reference.py
+6-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.