diff options
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 281eb8b..68c2c13 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -13,7 +13,6 @@ import json import sha import os import re -import urllib import sys import traceback import collections @@ -23,6 +22,11 @@ import string from websocket import create_connection, WebSocketConnectionClosedException +try: + from urllib.parse import urlencode +except ImportError: + from urllib import urlencode + # hack to make tests possible.. better way? try: import weechat @@ -1014,7 +1018,7 @@ class SlackRequest(object): post_data["token"] = token self.post_data = post_data self.params = {'useragent': 'wee_slack {}'.format(SCRIPT_VERSION)} - self.url = 'https://{}/api/{}?{}'.format(self.domain, request, urllib.urlencode(encode_to_utf8(post_data))) + self.url = 'https://{}/api/{}?{}'.format(self.domain, request, urlencode(encode_to_utf8(post_data))) self.response_id = sha.sha("{}{}".format(self.url, self.start_time)).hexdigest() self.retries = kwargs.get('retries', 3) # def __repr__(self): |