diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-04-02 12:54:11 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-04-08 15:11:57 +0200 |
commit | c2573979cc8b086c561b1eab2be59fd0de8d717b (patch) | |
tree | 4a314ca9956ad8f1e625e33e727d6370f456088f | |
parent | f6ee3793888768ebb90868cab0dc7bae8c49e9a3 (diff) | |
download | wee-slack-c2573979cc8b086c561b1eab2be59fd0de8d717b.tar.gz |
Various fixes for python 3
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py index ddb4686..e89c8a6 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1239,7 +1239,7 @@ class SlackTeam(object): else: ws = create_connection(self.ws_url, sslopt=sslopt_ca_certs) - self.hook = w.hook_fd(ws.sock._sock.fileno(), 1, 0, 0, "receive_ws_callback", self.get_team_hash()) + self.hook = w.hook_fd(ws.sock.fileno(), 1, 0, 0, "receive_ws_callback", self.get_team_hash()) ws.sock.setblocking(0) self.ws = ws # self.attach_websocket(ws) @@ -1303,7 +1303,7 @@ class SlackTeam(object): # json we can send. # We should try to be smarter to fetch the users whom we want to # subscribe to. - users = self.users.keys()[0:750] + users = list(self.users.keys())[0:750] self.send_to_websocket({ "type": "presence_sub", "ids": users, @@ -4570,7 +4570,7 @@ if __name__ == "__main__": # attach to the weechat hooks we need - tokens = map(string.strip, config.slack_api_token.split(',')) + tokens = [token.strip() for token in config.slack_api_token.split(',')] w.prnt('', 'Connecting to {} slack team{}.' .format(len(tokens), '' if len(tokens) == 1 else 's')) for t in tokens: |