Skip to content

Commit

Permalink
Fixed unloading of python modules which were imported using "from X i…
Browse files Browse the repository at this point in the history
…mport 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
  • Loading branch information
wonder committed Jun 8, 2010
1 parent 4d6c310 commit d236174
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/utils.py
Expand Up @@ -298,7 +298,13 @@ def _import(name, globals={}, locals={}, fromlist=[], level=-1):
if package_name not in _plugin_modules:
_plugin_modules[package_name] = set()
_plugin_modules[package_name].add(module_name)

# check the fromlist for additional modules (from X import Y,Z)
if fromlist:
for fromitem in fromlist:
frmod = module_name + "." + fromitem
if frmod in sys.modules:
_plugin_modules[package_name].add(frmod)

return mod

__builtin__.__import__ = _import

0 comments on commit d236174

Please sign in to comment.