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@13627 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jun 2, 2010
1 parent dcbbbfc commit f18cc52
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python/qgspythonutilsimpl.cpp
Original file line number Diff line number Diff line change
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 f18cc52

Please sign in to comment.