diff options
author | 2019-10-02 06:44:21 +0200 | |
---|---|---|
committer | 2019-10-02 06:44:21 +0200 | |
commit | a70cf2070f6af0b7710b0934b7e812dce78330d0 (patch) | |
tree | 9bda0654dcbf18fdc6f5c3812b9f2623833c6c08 /tests/test_api.py | |
parent | Merge pull request #480 from python-discord/separate_tools_and_resources (diff) |
Fix `cog_unload` bug in WatchChannel ABC
https://github.com/python-discord/bot/issues/482
There was small bug in the `cog_unload` method of the WatchChannel
ABC in `bot.cogs.watchchannels.watchchannel`. The problem was that it
tries to check if the Task assigned to `self._consume_task` is done
by accessing its `done` method. However, if a watch channel has not
yet relayed messages after the bot has started, it will not have a
consumption task yet, meaning this `_consume_task` attribute will be
assigned to `None`.
The solution is to change the `if` condition to:
`if self._consume_task and not self._consume_task.done():`
This commit closes #482
Diffstat (limited to 'tests/test_api.py')
0 files changed, 0 insertions, 0 deletions