diff --git a/socketio/asyncio_client.py b/socketio/asyncio_client.py index db79b337..583da3c0 100644 --- a/socketio/asyncio_client.py +++ b/socketio/asyncio_client.py @@ -218,7 +218,7 @@ def event_callback(*args): six.raise_from(exceptions.TimeoutError(), None) return callback_args[0] if len(callback_args[0]) > 1 \ else callback_args[0][0] if len(callback_args[0]) == 1 \ - else None + else None async def disconnect(self): """Disconnect from the server. diff --git a/socketio/asyncio_server.py b/socketio/asyncio_server.py index ecdc1bf2..2bdfdcf8 100644 --- a/socketio/asyncio_server.py +++ b/socketio/asyncio_server.py @@ -200,7 +200,7 @@ def event_callback(*args): six.raise_from(exceptions.TimeoutError(), None) return callback_args[0] if len(callback_args[0]) > 1 \ else callback_args[0][0] if len(callback_args[0]) == 1 \ - else None + else None async def close_room(self, room, namespace=None): """Close a room. diff --git a/socketio/client.py b/socketio/client.py index 0c49bbcc..4f1f146e 100644 --- a/socketio/client.py +++ b/socketio/client.py @@ -314,7 +314,7 @@ def event_callback(*args): raise exceptions.TimeoutError() return callback_args[0] if len(callback_args[0]) > 1 \ else callback_args[0][0] if len(callback_args[0]) == 1 \ - else None + else None def disconnect(self): """Disconnect from the server.""" diff --git a/socketio/packet.py b/socketio/packet.py index e1e080b1..73b469d6 100644 --- a/socketio/packet.py +++ b/socketio/packet.py @@ -14,7 +14,7 @@ class Packet(object): # the format of the Socket.IO packet is as follows: # - # type: 1 byte, values 0-6 + # packet type: 1 byte, values 0-6 # num_attachments: ASCII encoded, only if num_attachments != 0 # '-': only if num_attachments != 0 # namespace: only if namespace != '/' diff --git a/socketio/server.py b/socketio/server.py index 3dd18a36..89edca50 100644 --- a/socketio/server.py +++ b/socketio/server.py @@ -321,7 +321,7 @@ def event_callback(*args): raise exceptions.TimeoutError() return callback_args[0] if len(callback_args[0]) > 1 \ else callback_args[0][0] if len(callback_args[0]) == 1 \ - else None + else None def enter_room(self, sid, room, namespace=None): """Enter a room. diff --git a/tests/asyncio/test_asyncio_server.py b/tests/asyncio/test_asyncio_server.py index d160b306..54c27b48 100644 --- a/tests/asyncio/test_asyncio_server.py +++ b/tests/asyncio/test_asyncio_server.py @@ -10,7 +10,7 @@ else: import mock -from socketio import asyncio_server, exceptions +from socketio import asyncio_server from socketio import asyncio_namespace from socketio import exceptions from socketio import namespace @@ -134,7 +134,7 @@ def test_call_without_async_handlers(self, eio): s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False) self.assertRaises(RuntimeError, _run, - s.call('foo', sid='123', timeout=12)) + s.call('foo', sid='123', timeout=12)) def test_enter_room(self, eio): mgr = self._get_mock_manager() @@ -448,7 +448,8 @@ def test_handle_event_binary(self, eio): def test_handle_event_binary_ack(self, eio): eio.return_value.send = AsyncMock() mgr = self._get_mock_manager() - s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False) + s = asyncio_server.AsyncServer(client_manager=mgr, + async_handlers=False) s.manager.initialize(s) _run(s._handle_eio_message('123', '61-321["my message","a",' '{"_placeholder":true,"num":0}]')) @@ -479,7 +480,8 @@ def test_handle_event_with_ack_none(self, eio): def test_handle_event_with_ack_tuple(self, eio): eio.return_value.send = AsyncMock() mgr = self._get_mock_manager() - s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False) + s = asyncio_server.AsyncServer(client_manager=mgr, + async_handlers=False) handler = mock.MagicMock(return_value=(1, '2', True)) s.on('my message', handler) _run(s._handle_eio_message('123', '21000["my message","a","b","c"]')) @@ -490,7 +492,8 @@ def test_handle_event_with_ack_tuple(self, eio): def test_handle_event_with_ack_list(self, eio): eio.return_value.send = AsyncMock() mgr = self._get_mock_manager() - s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False) + s = asyncio_server.AsyncServer(client_manager=mgr, + async_handlers=False) handler = mock.MagicMock(return_value=[1, '2', True]) s.on('my message', handler) _run(s._handle_eio_message('123', '21000["my message","a","b","c"]')) @@ -501,7 +504,8 @@ def test_handle_event_with_ack_list(self, eio): def test_handle_event_with_ack_binary(self, eio): eio.return_value.send = AsyncMock() mgr = self._get_mock_manager() - s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False) + s = asyncio_server.AsyncServer(client_manager=mgr, + async_handlers=False) handler = mock.MagicMock(return_value=b'foo') s.on('my message', handler) _run(s._handle_eio_message('123', '21000["my message","foo"]')) diff --git a/tests/common/test_server.py b/tests/common/test_server.py index 280854a6..2b9f9447 100644 --- a/tests/common/test_server.py +++ b/tests/common/test_server.py @@ -424,7 +424,8 @@ def test_handle_event_with_ack_list(self, eio): def test_handle_event_with_ack_binary(self, eio): mgr = mock.MagicMock() - s = server.Server(client_manager=mgr, binary=True, async_handlers=False) + s = server.Server(client_manager=mgr, binary=True, + async_handlers=False) handler = mock.MagicMock(return_value=b'foo') s.on('my message', handler) s._handle_eio_message('123', '21000["my message","foo"]')