Skip to content

Commit d236174

Browse files
author
wonder
committed
Fixed unloading of python modules which were imported using "from X import Y,Z".
Modules Y,Z have been missed by the import wrapper and the unloader did not remove the plugin completely/correctly. git-svn-id: http://svn.osgeo.org/qgis/trunk@13693 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4d6c310 commit d236174

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/utils.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,13 @@ def _import(name, globals={}, locals={}, fromlist=[], level=-1):
298298
if package_name not in _plugin_modules:
299299
_plugin_modules[package_name] = set()
300300
_plugin_modules[package_name].add(module_name)
301-
301+
# check the fromlist for additional modules (from X import Y,Z)
302+
if fromlist:
303+
for fromitem in fromlist:
304+
frmod = module_name + "." + fromitem
305+
if frmod in sys.modules:
306+
_plugin_modules[package_name].add(frmod)
307+
302308
return mod
303309

304310
__builtin__.__import__ = _import

0 commit comments

Comments
 (0)