Skip to content

Commit 4829bcb

Browse files
committed
Squash a Python2 SparkData Bug
Python2 is raising TypeErrors when SparkData objects are initialized via unicode strings. Update `_json_dict()` to check that the json string is an instance of `basestring` and not the `str` subclass.
1 parent f89ffdb commit 4829bcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ciscosparkapi/sparkdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _json_dict(json):
5656
"""
5757
if isinstance(json, dict):
5858
return json
59-
elif isinstance(json, str):
59+
elif isinstance(json, basestring):
6060
return json_pkg.loads(json, object_hook=OrderedDict)
6161
else:
6262
error = "'json' must be a dictionary or valid JSON string; " \

0 commit comments

Comments
 (0)