Skip to content
Permalink
Browse files
Fixed unloading of python modules which were imported using "from X i…
…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 d23617474bdc8f6354168ba1067b1393d15bafc5
Showing with 7 additions and 1 deletion.
  1. +7 −1 python/utils.py
@@ -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.