[QGIS Commit] r13627 - trunk/qgis/src/python

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Jun 2 09:38:38 EDT 2010


Author: jef
Date: 2010-06-02 09:38:36 -0400 (Wed, 02 Jun 2010)
New Revision: 13627

Modified:
   trunk/qgis/src/python/qgspythonutilsimpl.cpp
Log:
fix python runtime error when no HOME is set

Modified: trunk/qgis/src/python/qgspythonutilsimpl.cpp
===================================================================
--- trunk/qgis/src/python/qgspythonutilsimpl.cpp	2010-06-02 10:52:41 UTC (rev 13626)
+++ trunk/qgis/src/python/qgspythonutilsimpl.cpp	2010-06-02 13:38:36 UTC (rev 13627)
@@ -62,12 +62,13 @@
   // 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



More information about the QGIS-commit mailing list