Skip to content

Commit 18fa528

Browse files
flake8 fixes
1 parent b46dc0f commit 18fa528

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

socketio/asyncio_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def event_callback(*args):
218218
six.raise_from(exceptions.TimeoutError(), None)
219219
return callback_args[0] if len(callback_args[0]) > 1 \
220220
else callback_args[0][0] if len(callback_args[0]) == 1 \
221-
else None
221+
else None
222222

223223
async def disconnect(self):
224224
"""Disconnect from the server.

socketio/asyncio_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def event_callback(*args):
200200
six.raise_from(exceptions.TimeoutError(), None)
201201
return callback_args[0] if len(callback_args[0]) > 1 \
202202
else callback_args[0][0] if len(callback_args[0]) == 1 \
203-
else None
203+
else None
204204

205205
async def close_room(self, room, namespace=None):
206206
"""Close a room.

socketio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def event_callback(*args):
314314
raise exceptions.TimeoutError()
315315
return callback_args[0] if len(callback_args[0]) > 1 \
316316
else callback_args[0][0] if len(callback_args[0]) == 1 \
317-
else None
317+
else None
318318

319319
def disconnect(self):
320320
"""Disconnect from the server."""

socketio/packet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Packet(object):
1414

1515
# the format of the Socket.IO packet is as follows:
1616
#
17-
# type: 1 byte, values 0-6
17+
# packet type: 1 byte, values 0-6
1818
# num_attachments: ASCII encoded, only if num_attachments != 0
1919
# '-': only if num_attachments != 0
2020
# namespace: only if namespace != '/'

socketio/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def event_callback(*args):
321321
raise exceptions.TimeoutError()
322322
return callback_args[0] if len(callback_args[0]) > 1 \
323323
else callback_args[0][0] if len(callback_args[0]) == 1 \
324-
else None
324+
else None
325325

326326
def enter_room(self, sid, room, namespace=None):
327327
"""Enter a room.

tests/asyncio/test_asyncio_server.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
else:
1111
import mock
1212

13-
from socketio import asyncio_server, exceptions
13+
from socketio import asyncio_server
1414
from socketio import asyncio_namespace
1515
from socketio import exceptions
1616
from socketio import namespace
@@ -134,7 +134,7 @@ def test_call_without_async_handlers(self, eio):
134134
s = asyncio_server.AsyncServer(client_manager=mgr,
135135
async_handlers=False)
136136
self.assertRaises(RuntimeError, _run,
137-
s.call('foo', sid='123', timeout=12))
137+
s.call('foo', sid='123', timeout=12))
138138

139139
def test_enter_room(self, eio):
140140
mgr = self._get_mock_manager()
@@ -448,7 +448,8 @@ def test_handle_event_binary(self, eio):
448448
def test_handle_event_binary_ack(self, eio):
449449
eio.return_value.send = AsyncMock()
450450
mgr = self._get_mock_manager()
451-
s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False)
451+
s = asyncio_server.AsyncServer(client_manager=mgr,
452+
async_handlers=False)
452453
s.manager.initialize(s)
453454
_run(s._handle_eio_message('123', '61-321["my message","a",'
454455
'{"_placeholder":true,"num":0}]'))
@@ -479,7 +480,8 @@ def test_handle_event_with_ack_none(self, eio):
479480
def test_handle_event_with_ack_tuple(self, eio):
480481
eio.return_value.send = AsyncMock()
481482
mgr = self._get_mock_manager()
482-
s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False)
483+
s = asyncio_server.AsyncServer(client_manager=mgr,
484+
async_handlers=False)
483485
handler = mock.MagicMock(return_value=(1, '2', True))
484486
s.on('my message', handler)
485487
_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):
490492
def test_handle_event_with_ack_list(self, eio):
491493
eio.return_value.send = AsyncMock()
492494
mgr = self._get_mock_manager()
493-
s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False)
495+
s = asyncio_server.AsyncServer(client_manager=mgr,
496+
async_handlers=False)
494497
handler = mock.MagicMock(return_value=[1, '2', True])
495498
s.on('my message', handler)
496499
_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):
501504
def test_handle_event_with_ack_binary(self, eio):
502505
eio.return_value.send = AsyncMock()
503506
mgr = self._get_mock_manager()
504-
s = asyncio_server.AsyncServer(client_manager=mgr, async_handlers=False)
507+
s = asyncio_server.AsyncServer(client_manager=mgr,
508+
async_handlers=False)
505509
handler = mock.MagicMock(return_value=b'foo')
506510
s.on('my message', handler)
507511
_run(s._handle_eio_message('123', '21000["my message","foo"]'))

tests/common/test_server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ def test_handle_event_with_ack_list(self, eio):
424424

425425
def test_handle_event_with_ack_binary(self, eio):
426426
mgr = mock.MagicMock()
427-
s = server.Server(client_manager=mgr, binary=True, async_handlers=False)
427+
s = server.Server(client_manager=mgr, binary=True,
428+
async_handlers=False)
428429
handler = mock.MagicMock(return_value=b'foo')
429430
s.on('my message', handler)
430431
s._handle_eio_message('123', '21000["my message","foo"]')

0 commit comments

Comments
 (0)