Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pyromod/listen/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ async def stop_listening(
async def stop_listener(self, listener: Listener):
self.remove_listener(listener)

if listener.future.done():
# we have to check if listener.future is not None [incase of Client.next_step_handler is used this will be None]
if listner.future is not None and listener.future.done():
return

if callable(config.stopped_handler):
Expand All @@ -204,7 +205,8 @@ async def stop_listener(self, listener: Listener):
None, config.stopped_handler, None, listener
)
elif config.throw_exceptions:
listener.future.set_exception(ListenerStopped())
if listener.future is not None:
listener.future.set_exception(ListenerStopped())

@should_patch()
def register_next_step_handler(
Expand Down