diff options
-rw-r--r-- | _pytest/conftest.py | 2 | ||||
-rw-r--r-- | wee_slack.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/_pytest/conftest.py b/_pytest/conftest.py index f744dae..951797a 100644 --- a/_pytest/conftest.py +++ b/_pytest/conftest.py @@ -32,6 +32,8 @@ def realish_eventrouter(mock_weechat): e = EventRouter() context = e.store_context(SlackRequest('xoxoxoxox', "rtm.start", {"meh": "blah"})) rtmstartdata = open('_pytest/data/http/rtm.start.json', 'r').read() + if sys.version_info.major == 2: + rtmstartdata = rtmstartdata.decode('utf-8') e.receive_httprequest_callback(context, 1, 0, rtmstartdata, 4) while len(e.queue): e.handle_next() diff --git a/wee_slack.py b/wee_slack.py index a612869..281eb8b 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -4,6 +4,7 @@ from __future__ import print_function, unicode_literals from collections import OrderedDict from functools import wraps +from io import StringIO from itertools import islice, count import textwrap @@ -19,10 +20,6 @@ import collections import ssl import random import string -try: - from cStringIO import StringIO -except: - from StringIO import StringIO from websocket import create_connection, WebSocketConnectionClosedException |