Sfoglia il codice sorgente

don't crash when .grassrc7 is missing

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38531 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 anni fa
parent
commit
f91b0ec3bb
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      lib/init/grass.py

+ 3 - 3
lib/init/grass.py

@@ -194,11 +194,11 @@ def read_gui():
 	# Check for a reference to the GRASS user interface in the grassrc file
 	if os.access(gisrc, os.R_OK):
 	    kv = read_gisrc()
-	    if 'GRASS_GUI' not in kv:
+	    if not kv.has_key('GRASS_GUI'):
 		# Set the GRASS user interface to the default if needed
 		grass_gui = default_gui
-        else:
-            grass_gui = kv['GRASS_GUI']
+            else:
+                grass_gui = kv['GRASS_GUI']
     
     if not grass_gui:
 	grass_gui = default_gui