PluginManager: prefer plugins in user path

As we always load plugins from the user path first, we should not
reload them later from Gajims plugin base dir
This commit is contained in:
Philipp Hörist 2017-08-07 19:58:18 +02:00
parent 7e0e4cced0
commit 635ce52856
1 changed files with 5 additions and 0 deletions

View File

@ -531,6 +531,11 @@ class PluginManager(metaclass=Singleton):
try:
if module_name in sys.modules:
if path == gajim.PLUGINS_DIRS[0]:
# Only reload plugins from Gajim base dir when they
# dont exist. This means plugins in the user path are
# always preferred.
continue
from imp import reload
log.info('Reloading %s', module_name)
module = reload(sys.modules[module_name])