[GRASS-SVN] r64692 - grass/branches/releasebranch_7_0/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 19 11:43:52 PST 2015


Author: neteler
Date: 2015-02-19 11:43:52 -0800 (Thu, 19 Feb 2015)
New Revision: 64692

Modified:
   grass/branches/releasebranch_7_0/lib/init/grass.py
Log:
grass.py: fix startup in case of missing SHELL var (eg docker) (trunk, r64684 + r64688)

Modified: grass/branches/releasebranch_7_0/lib/init/grass.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/init/grass.py	2015-02-19 18:41:35 UTC (rev 64691)
+++ grass/branches/releasebranch_7_0/lib/init/grass.py	2015-02-19 19:43:52 UTC (rev 64692)
@@ -900,10 +900,17 @@
         os.environ['SHELL'] = "/usr/bin/bash.exe"
         os.environ['OSTYPE'] = "cygwin"
     else:
-        sh = os.path.basename(os.getenv('SHELL'))
+        # in docker the 'SHELL' variable may not be
+        # visible in a Python session
+        try:
+            sh = os.path.basename(os.getenv('SHELL'))
+        except:
+            sh = 'sh'
+            os.environ['SHELL'] = sh
+        
         if windows and sh:
             sh = os.path.splitext(sh)[0]
-
+        
         if sh == "ksh":
             shellname = "Korn Shell"
         elif sh == "csh":



More information about the grass-commit mailing list