From d7c96e231ef10e3d604d88454dadc639b6e29bdc Mon Sep 17 00:00:00 2001 From: Seth Foster Date: Tue, 15 Nov 2022 12:00:23 -0500 Subject: [PATCH] fix lint --- channels/consumer.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/channels/consumer.py b/channels/consumer.py index 120e7e75..df4b4f98 100644 --- a/channels/consumer.py +++ b/channels/consumer.py @@ -50,10 +50,12 @@ async def __call__(self, scope, receive, send): # Handler to call when dispatch task is cancelled cancel_callback = None try: - if callable(self.channel_layer.clean_channel): - cancel_callback = functools.partial(self.channel_layer.clean_channel, self.channel_name) + if callable(self.channel_layer.clean_channel): + cancel_callback = functools.partial( + self.channel_layer.clean_channel, self.channel_name + ) except AttributeError: - pass + pass # Store send function if self._sync: self.base_send = async_to_sync(send) @@ -63,7 +65,9 @@ async def __call__(self, scope, receive, send): try: if self.channel_layer is not None: await await_many_dispatch( - [receive, self.channel_receive], self.dispatch, cancel_callback=cancel_callback + [receive, self.channel_receive], + self.dispatch, + cancel_callback=cancel_callback, ) else: await await_many_dispatch([receive], self.dispatch)