mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
fix #1038
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8340 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
af391215b8
commit
db9872328f
@ -346,11 +346,26 @@ bool QgsPythonUtils::loadPlugin(QString packageName)
|
||||
" reload(" + packageName + ")\n"
|
||||
" __main__.__plugin_result = 'OK'\n"
|
||||
"except:\n"
|
||||
" qgis_except_hook_msg(sys.exc_type, sys.exc_value, sys.exc_traceback, "
|
||||
" 'Couldn\\'t load plugin \"" + packageName + "\"')\n"
|
||||
" __main__.__plugin_result = 'ERROR'\n");
|
||||
|
||||
return (getVariableFromMain("__plugin_result") == "OK");
|
||||
|
||||
if( getVariableFromMain("__plugin_result") == "OK" )
|
||||
return true;
|
||||
|
||||
// snake in the grass, we know it's there
|
||||
runString("sys.path_importer_cache.clear()");
|
||||
|
||||
// retry
|
||||
runString(
|
||||
"try:\n"
|
||||
" import " + packageName + "\n"
|
||||
" reload(" + packageName + ")\n"
|
||||
" __main__.__plugin_result = 'OK'\n"
|
||||
"except:\n"
|
||||
" qgis_except_hook_msg(sys.exc_type, sys.exc_value, sys.exc_traceback, "
|
||||
"'Couldn\\'t load plugin \"" + packageName + "\" from [\\'' + '\\', \\''.join(sys.path) + '\\']')\n"
|
||||
" __main__.__plugin_result = 'ERROR'\n");
|
||||
|
||||
return getVariableFromMain("__plugin_result") == "OK";
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user