mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
[commands] unload cog submodules
When unloading cogs, currently we do not remove submodules from sys.modules, meaning they will not be reloaded. Removing here makes new imports reload from file. Of course, any already imported modules will still hold a reference to the old module, since they will not re-import it, and will not be forcably unloaded.
This commit is contained in:
parent
a037d469d7
commit
fc22d288be
@ -768,6 +768,9 @@ class BotBase(GroupMixin):
|
||||
del lib
|
||||
del self.extensions[name]
|
||||
del sys.modules[name]
|
||||
for module in list(sys.modules.keys()):
|
||||
if _is_submodule(lib_name, module):
|
||||
del sys.modules[module]
|
||||
|
||||
# command processing
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user