From 635ce52856d4a71f4b2f9928e30bbe89d25847c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 7 Aug 2017 19:58:18 +0200 Subject: [PATCH] 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 --- gajim/plugins/pluginmanager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gajim/plugins/pluginmanager.py b/gajim/plugins/pluginmanager.py index 4fadae186..c528b3935 100644 --- a/gajim/plugins/pluginmanager.py +++ b/gajim/plugins/pluginmanager.py @@ -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])