[GRASS-SVN] r64684 - grass/trunk/lib/init
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Feb 19 07:03:05 PST 2015
Author: neteler
Date: 2015-02-19 07:03:05 -0800 (Thu, 19 Feb 2015)
New Revision: 64684
Modified:
grass/trunk/lib/init/grass.py
Log:
grass.py: fix startup in case of missing SHELL var (eg docker)
Modified: grass/trunk/lib/init/grass.py
===================================================================
--- grass/trunk/lib/init/grass.py 2015-02-19 04:32:40 UTC (rev 64683)
+++ grass/trunk/lib/init/grass.py 2015-02-19 15:03:05 UTC (rev 64684)
@@ -901,7 +901,13 @@
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]
More information about the grass-commit
mailing list