diff --git a/src/gen/plug/_manager.py b/src/gen/plug/_manager.py index 7026a27f9..5705b881a 100644 --- a/src/gen/plug/_manager.py +++ b/src/gen/plug/_manager.py @@ -256,11 +256,11 @@ class BasePluginManager(object): """ Reloads modules that might not be in the path. """ - if pdata.mod_name in sys.modules: - del sys.modules[pdata.mod_name] try: reload(module) except: + if pdata.mod_name in sys.modules: + del sys.modules[pdata.mod_name] module = self.import_plugin(pdata) return module