Skip to content

Commit f014b4f

Browse files
committedApr 19, 2014
[processing] prevent grass installation check returning None when folder not set under windows
1 parent 1d821d6 commit f014b4f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎python/plugins/processing/algs/grass/GrassUtils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,19 @@ def grassPath():
8888
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER)
8989
if folder is None:
9090
if isWindows():
91-
testfolder = os.path.dirname(str(QgsApplication.prefixPath()))
91+
testfolder = os.path.dirname(QgsApplication.prefixPath())
9292
testfolder = os.path.join(testfolder, 'grass')
9393
if os.path.isdir(testfolder):
9494
for subfolder in os.listdir(testfolder):
9595
if subfolder.startswith('grass'):
9696
folder = os.path.join(testfolder, subfolder)
97-
break
97+
break
9898
else:
99-
folder = os.path.join(str(QgsApplication.prefixPath()), 'grass'
100-
)
99+
folder = os.path.join(QgsApplication.prefixPath(), 'grass')
101100
if not os.path.isdir(folder):
102101
folder = '/Applications/GRASS-6.4.app/Contents/MacOS'
103102

104-
return folder
103+
return folder or ''
105104

106105
@staticmethod
107106
def grassWinShell():

0 commit comments

Comments
 (0)
Please sign in to comment.