Skip to content

Commit 2ab6541

Browse files
SebbyLawbijij
andauthored
[commands] Document exceptions being ignored in teardown and cog_unload
Co-authored-by: Josh <[email protected]>
1 parent 0e727d8 commit 2ab6541

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

discord/ext/commands/cog.py

+2
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ async def cog_unload(self) -> None:
550550
551551
Subclasses must replace this if they want special unloading behaviour.
552552
553+
Exceptions raised in this method are ignored during extension unloading.
554+
553555
.. versionchanged:: 2.0
554556
555557
This method can now be a :term:`coroutine`.

docs/ext/commands/extensions.rst

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ Cleaning Up
5454

5555
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.
5656

57+
Exceptions raised in the ``teardown`` function are ignored, and the extension is still unloaded.
58+
5759
.. code-block:: python3
5860
:caption: basic_ext.py
5961

0 commit comments

Comments
 (0)