[processing][grass] Fix incorrect path calculation for grass binary

This commit is contained in:
Nyall Dawson 2018-03-26 16:22:44 +10:00
parent bec878f6f9
commit 8e08bda46c

View File

@ -140,14 +140,12 @@ class Grass7Utils:
Inline function to search for grass binaries into a folder Inline function to search for grass binaries into a folder
with os.walk with os.walk
""" """
command = None
if os.path.exists(folder): if os.path.exists(folder):
for root, dirs, files in os.walk(folder): for root, dirs, files in os.walk(folder):
for cmd in cmdList: for cmd in cmdList:
if cmd in files: if cmd in files:
command = os.path.join(root, cmd) return os.path.join(root, cmd)
break return None
return command
if Grass7Utils.command: if Grass7Utils.command:
return Grass7Utils.command return Grass7Utils.command