Skip to content

Commit eabfc26

Browse files
committed
Testing on six.string_types to be 2 and 3 friendly.
* `six` is already required by websocket-client so it doesn't add much weight to the overall installation.
1 parent 5f6e525 commit eabfc26

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
install_requires=[
1212
'websocket-client',
1313
'requests',
14+
'six',
1415
],
1516
zip_safe=False)

slackclient/_slackrequest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import json
2+
23
import requests
4+
import six
35

46

57
class SlackRequest(object):
@@ -8,8 +10,8 @@ class SlackRequest(object):
810
def do(token, request="?", post_data=None, domain="slack.com"):
911
post_data = post_data or {}
1012

11-
for k, v in post_data.items():
12-
if not isinstance(v, (str, unicode)):
13+
for k, v in six.iteritems(post_data):
14+
if not isinstance(v, six.string_types):
1315
post_data[k] = json.dumps(v)
1416

1517
url = 'https://{0}/api/{1}'.format(domain, request)

0 commit comments

Comments
 (0)