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/qgis@13693 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 8, 2010
1 parent 2b4c349 commit 097b287
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/utils.py
Original file line number Diff line number Diff line change
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 097b287

Please sign in to comment.