[QGIS Commit] r13693 - trunk/qgis/python

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jun 8 16:05:54 EDT 2010


Author: wonder
Date: 2010-06-08 16:05:53 -0400 (Tue, 08 Jun 2010)
New Revision: 13693

Modified:
   trunk/qgis/python/utils.py
Log:
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.


Modified: trunk/qgis/python/utils.py
===================================================================
--- trunk/qgis/python/utils.py	2010-06-08 19:27:04 UTC (rev 13692)
+++ trunk/qgis/python/utils.py	2010-06-08 20:05:53 UTC (rev 13693)
@@ -298,7 +298,13 @@
       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



More information about the QGIS-commit mailing list