Skip to content

Commit 9074b14

Browse files
committed
[processing] fix to avoid interrupted system call exceptions in mac
1 parent f0527e4 commit 9074b14

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

python/plugins/processing/algs/otb/OTBUtils.py

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import os
3232
import re
33+
import time
3334
from qgis.PyQt.QtCore import QCoreApplication
3435
from qgis.core import QgsApplication
3536
import subprocess
@@ -160,6 +161,8 @@ def executeOtb(commands, progress, addToLog=True):
160161
os.putenv('ITK_AUTOLOAD_PATH', otbLibPath())
161162
fused_command = ''.join(['"%s" ' % re.sub(r'^"|"$', '', c) for c in commands])
162163
proc = subprocess.Popen(fused_command, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull), stderr=subprocess.STDOUT, universal_newlines=True).stdout
164+
if isMac(): #This trick avoids having an uninterrupted system call exception if OTB is not installed
165+
time.sleep(1)
163166
for line in iter(proc.readline, ""):
164167
if "[*" in line:
165168
idx = line.find("[*")

python/plugins/processing/algs/saga/SagaUtils.py

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import os
2929
import stat
3030
import subprocess
31+
import time
3132

3233
from qgis.PyQt.QtCore import QCoreApplication
3334
from qgis.core import QgsApplication
@@ -133,6 +134,8 @@ def getSagaInstalledVersion(runSaga=False):
133134
stderr=subprocess.STDOUT,
134135
universal_newlines=True,
135136
).stdout
137+
if isMac(): #This trick avoids having an uninterrupted system call exception if SAGA is not installed
138+
time.sleep(1)
136139
try:
137140
lines = proc.readlines()
138141
for line in lines:

0 commit comments

Comments
 (0)