Skip to content

Commit

Permalink
fix python runtime error when no HOME is set
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13627 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 2, 2010
1 parent 20f3504 commit 518a268
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python/qgspythonutilsimpl.cpp
Expand Up @@ -62,12 +62,13 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
// expect that bindings are installed locally, so add the path to modules
// also add path to plugins
#ifdef Q_OS_WIN
runString( "oldhome=None\n" );
runString( "if os.environ.has_key('HOME'): oldhome=os.environ['HOME']\n" );
runString( "os.environ['HOME']=os.environ['USERPROFILE']" );
#endif
runString( "sys.path = [\"" + pythonPath() + "\", os.path.expanduser(\"~/.qgis/python\"), os.path.expanduser(\"~/.qgis/python/plugins\"), \"" + pluginsPath() + "\" ] + sys.path" );
#ifdef Q_OS_WIN
runString( "if os.environ.has_key('HOME'): os.environ['HOME']=oldhome\n" );
runString( "if oldhome: os.environ['HOME']=oldhome\n" );
#endif

// import SIP
Expand Down

0 comments on commit 518a268

Please sign in to comment.