##// END OF EJS Templates
Unload extension before reloading it.
Thomas Kluyver -
Show More
@@ -114,13 +114,15 b' class ExtensionManager(Configurable):'
114 """
114 """
115 from IPython.utils.syspathcontext import prepended_to_syspath
115 from IPython.utils.syspathcontext import prepended_to_syspath
116
116
117 with prepended_to_syspath(self.ipython_extension_dir):
117 if (module_str in self.loaded) and (module_str in sys.modules):
118 if module_str in sys.modules:
118 self.unload_extension(module_str)
119 mod = sys.modules[module_str]
119 mod = sys.modules[module_str]
120 with prepended_to_syspath(self.ipython_extension_dir):
120 reload(mod)
121 reload(mod)
121 self._call_load_ipython_extension(mod)
122 if self._call_load_ipython_extension(mod):
122 else:
123 self.loaded.add(module_str)
123 self.load_extension(module_str)
124 else:
125 self.load_extension(module_str)
124
126
125 def _call_load_ipython_extension(self, mod):
127 def _call_load_ipython_extension(self, mod):
126 if hasattr(mod, 'load_ipython_extension'):
128 if hasattr(mod, 'load_ipython_extension'):
General Comments 0
You need to be logged in to leave comments. Login now