diff options
| author | 2020-10-10 08:38:49 +0300 | |
|---|---|---|
| committer | 2020-10-10 08:38:49 +0300 | |
| commit | b702618d8a9189e19c3107c79e23105e288798b0 (patch) | |
| tree | c221b85ec11f1d0503d92e386855a39e8e982751 | |
| parent | Fix name of extensions removing function (diff) | |
Get all extensions first for unloading to avoid iteration error
| -rw-r--r-- | bot/bot.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/bot.py b/bot/bot.py index e6d77344e..9a60474b3 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -136,7 +136,9 @@ class Bot(commands.Bot): def _remove_extensions(self) -> None: """Remove all extensions to trigger cog unloads.""" - for ext in self.extensions.keys(): + extensions = list(self.extensions.keys()) + + for ext in extensions: try: self.unload_extension(ext) except Exception: |