Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8557 from juanmpd/patch-1
Update Grass7Utils.py. Fixes #20632 #20502
  • Loading branch information
luipir committed Nov 27, 2018
2 parents 6cc41a9 + 31f3f69 commit 42e30b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/plugins/processing/algs/grass7/Grass7Utils.py
Expand Up @@ -400,6 +400,11 @@ def executeGrass(commands, feedback, outputCommands=None):
# commands again.
if not grassOutDone and outputCommands:
command, grassenv = Grass7Utils.prepareGrassExecution(outputCommands)
# For MS-Windows, we need to hide the console window.
if isWindows():
si = subprocess.STARTUPINFO()
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
si.wShowWindow = subprocess.SW_HIDE
with subprocess.Popen(
command,
shell=False,
Expand All @@ -408,6 +413,7 @@ def executeGrass(commands, feedback, outputCommands=None):
stderr=subprocess.STDOUT,
universal_newlines=True,
env=grassenv,
encoding="cp{}".format(Grass7Utils.getWindowsCodePage()) if isWindows() else None,
startupinfo=si if isWindows() else None
) as proc:
for line in iter(proc.stdout.readline, ''):
Expand Down

0 comments on commit 42e30b6

Please sign in to comment.