Browse Source

using sys.platform to determine if running in Cygwin

Checking CYGWIN environmental variable is unreliable. See ticket https://trac.osgeo.org/grass/ticket/2395.

It is not clear if sys.platform should be used with equals, in, or startswith but using equals here since it is safe for cygwin and it is used elsewhere.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61705 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 years ago
parent
commit
80dafe9939
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/init/grass.py

+ 1 - 1
lib/init/grass.py

@@ -905,7 +905,7 @@ def check_shell():
     global sh, shellname, grass_env_file
     global sh, shellname, grass_env_file
     # cygwin has many problems with the shell setup
     # cygwin has many problems with the shell setup
     # below, so i hardcoded everything here.
     # below, so i hardcoded everything here.
-    if os.getenv('CYGWIN'):
+    if sys.platform == 'cygwin':
         sh = "cygwin"
         sh = "cygwin"
         shellname = "GNU Bash (Cygwin)"
         shellname = "GNU Bash (Cygwin)"
         os.environ['SHELL'] = "/usr/bin/bash.exe"
         os.environ['SHELL'] = "/usr/bin/bash.exe"