From f014b4f0978220e9add37df0b2840d7542f2c28e Mon Sep 17 00:00:00 2001 From: Victor Olaya Date: Sat, 19 Apr 2014 17:39:14 +0200 Subject: [PATCH] [processing] prevent grass installation check returning None when folder not set under windows --- python/plugins/processing/algs/grass/GrassUtils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/plugins/processing/algs/grass/GrassUtils.py b/python/plugins/processing/algs/grass/GrassUtils.py index 566ff229dc5..338e9dd982c 100644 --- a/python/plugins/processing/algs/grass/GrassUtils.py +++ b/python/plugins/processing/algs/grass/GrassUtils.py @@ -88,20 +88,19 @@ class GrassUtils: folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER) if folder is None: if isWindows(): - testfolder = os.path.dirname(str(QgsApplication.prefixPath())) + testfolder = os.path.dirname(QgsApplication.prefixPath()) testfolder = os.path.join(testfolder, 'grass') if os.path.isdir(testfolder): for subfolder in os.listdir(testfolder): if subfolder.startswith('grass'): folder = os.path.join(testfolder, subfolder) - break + break else: - folder = os.path.join(str(QgsApplication.prefixPath()), 'grass' - ) + folder = os.path.join(QgsApplication.prefixPath(), 'grass') if not os.path.isdir(folder): folder = '/Applications/GRASS-6.4.app/Contents/MacOS' - return folder + return folder or '' @staticmethod def grassWinShell():