Skip to content
Permalink
Browse files
fix python runtime error when no HOME is set
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 518a2684ac881ee2267fe1a568bbb49f45464f45
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/python/qgspythonutilsimpl.cpp
@@ -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

0 comments on commit 518a268

Please sign in to comment.