Browse Source

[commands] Document exceptions being ignored in teardown and cog_unload

Co-authored-by: Josh <[email protected]>
pull/10109/head
Sebastian Law 2 years ago
committed by dolfies
parent
commit
0ab9b4c711
  1. 2
      discord/ext/commands/cog.py
  2. 2
      docs/ext/commands/extensions.rst

2
discord/ext/commands/cog.py

@ -353,6 +353,8 @@ class Cog(metaclass=CogMeta):
Subclasses must replace this if they want special unloading behaviour. Subclasses must replace this if they want special unloading behaviour.
Exceptions raised in this method are ignored during extension unloading.
.. versionchanged:: 2.0 .. versionchanged:: 2.0
This method can now be a :term:`coroutine`. This method can now be a :term:`coroutine`.

2
docs/ext/commands/extensions.rst

@ -54,6 +54,8 @@ Cleaning Up
Although rare, sometimes an extension needs to clean-up or know when it's being unloaded. For cases like these, there is another entry point named ``teardown`` which is similar to ``setup`` except called when the extension is unloaded. Although rare, sometimes an extension needs to clean-up or know when it's being unloaded. For cases like these, there is another entry point named ``teardown`` which is similar to ``setup`` except called when the extension is unloaded.
Exceptions raised in the ``teardown`` function are ignored, and the extension is still unloaded.
.. code-block:: python3 .. code-block:: python3
:caption: basic_ext.py :caption: basic_ext.py

Loading…
Cancel
Save