Skip to content

Commit 002f164

Browse files
committed
Add workaround for Python 3 hashlib compat.
1 parent b5110d3 commit 002f164

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plotly/graph_reference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import json
99
import requests
1010

11+
import six
12+
1113
from plotly import exceptions, files, utils
1214

1315
GRAPH_REFERENCE_PATH = '/v2/plot-schema'
@@ -33,7 +35,7 @@ def get_graph_reference():
3335
graph_reference = {}
3436
plotly_api_domain = default_config['plotly_api_domain']
3537

36-
sha1 = hashlib.sha1(str(graph_reference)).hexdigest()
38+
sha1 = hashlib.sha1(six.b(str(graph_reference))).hexdigest()
3739

3840
graph_reference_url = '{}{}?sha1={}'.format(plotly_api_domain,
3941
GRAPH_REFERENCE_PATH, sha1)

0 commit comments

Comments
 (0)