Skip to content

Commit 518a268

Browse files
author
jef
committed
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
1 parent 20f3504 commit 518a268

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/python/qgspythonutilsimpl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
6262
// expect that bindings are installed locally, so add the path to modules
6363
// also add path to plugins
6464
#ifdef Q_OS_WIN
65+
runString( "oldhome=None\n" );
6566
runString( "if os.environ.has_key('HOME'): oldhome=os.environ['HOME']\n" );
6667
runString( "os.environ['HOME']=os.environ['USERPROFILE']" );
6768
#endif
6869
runString( "sys.path = [\"" + pythonPath() + "\", os.path.expanduser(\"~/.qgis/python\"), os.path.expanduser(\"~/.qgis/python/plugins\"), \"" + pluginsPath() + "\" ] + sys.path" );
6970
#ifdef Q_OS_WIN
70-
runString( "if os.environ.has_key('HOME'): os.environ['HOME']=oldhome\n" );
71+
runString( "if oldhome: os.environ['HOME']=oldhome\n" );
7172
#endif
7273

7374
// import SIP

0 commit comments

Comments
 (0)