Skip to content

Commit 1c2e00c

Browse files
authored
Invalidate importlib caches before loading plugins (#1641)
This allows newly installed 3rd party dependencies and pip-installed plugins to become visible without restarting the bot.
1 parent 86b3d36 commit 1c2e00c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/plugin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def loadPluginModule(name, ignoreDeprecation=False):
7171
pluginDirs = conf.supybot.directories.plugins()[:]
7272
pluginDirs.append(_pluginsDir)
7373
module = None
74+
75+
# Invalidate caches to allow new third party dependencies and plugins to be
76+
# located without restarting the bot.
77+
importlib.invalidate_caches()
78+
7479
for dir in pluginDirs:
7580
try:
7681
files.extend(os.listdir(dir))

0 commit comments

Comments
 (0)