mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[processing] Use subprocess.DEVNULL instead of open(os.devnull)
This commit is contained in:
parent
6a99017bf0
commit
0484769b7d
@ -87,7 +87,7 @@ class GdalUtils(object):
|
||||
fused_command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
).stdout
|
||||
|
@ -277,7 +277,7 @@ class GrassUtils(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
env=grassenv
|
||||
@ -307,7 +307,7 @@ class GrassUtils(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
env=grassenv
|
||||
|
@ -258,7 +258,7 @@ class Grass7Utils(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
env=grassenv
|
||||
@ -287,7 +287,7 @@ class Grass7Utils(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
env=grassenv
|
||||
|
@ -68,7 +68,7 @@ class FusionUtils(object):
|
||||
commands,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=False,
|
||||
).stdout
|
||||
|
@ -71,7 +71,7 @@ class LAStoolsUtils(object):
|
||||
loglines.append(QCoreApplication.translate("LAStoolsUtils", "LAStools command line"))
|
||||
loglines.append(commandline)
|
||||
loglines.append(QCoreApplication.translate("LAStoolsUtils", "LAStools console output"))
|
||||
proc = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull),
|
||||
proc = subprocess.Popen(commandline, shell=True, stdout=subprocess.PIPE, stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT, universal_newlines=False).stdout
|
||||
for line in iter(proc.readline, ""):
|
||||
loglines.append(line)
|
||||
|
@ -161,7 +161,7 @@ def executeOtb(commands, progress, addToLog=True):
|
||||
loglines.append(tr("OTB execution console output"))
|
||||
os.putenv('ITK_AUTOLOAD_PATH', otbLibPath())
|
||||
fused_command = ''.join(['"%s" ' % re.sub(r'^"|"$', '', c) for c in commands])
|
||||
proc = subprocess.Popen(fused_command, shell=True, stdout=subprocess.PIPE, stdin=open(os.devnull), stderr=subprocess.STDOUT, universal_newlines=True).stdout
|
||||
proc = subprocess.Popen(fused_command, shell=True, stdout=subprocess.PIPE, stdin=subprocess.DEVNULL, stderr=subprocess.STDOUT, universal_newlines=True).stdout
|
||||
if isMac(): # This trick avoids having an uninterrupted system call exception if OTB is not installed
|
||||
time.sleep(1)
|
||||
for line in iter(proc.readline, ""):
|
||||
|
@ -146,7 +146,7 @@ class RUtils(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
)
|
||||
@ -213,7 +213,7 @@ class RUtils(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
).stdout
|
||||
|
@ -44,7 +44,7 @@ class SagaDescriptionCreator(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=f2,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
)
|
||||
@ -81,7 +81,7 @@ class SagaDescriptionCreator(object):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=f,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=f,
|
||||
universal_newlines=True,
|
||||
)
|
||||
|
@ -132,7 +132,7 @@ def getSagaInstalledVersion(runSaga=False):
|
||||
commands,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
).stdout
|
||||
@ -167,7 +167,7 @@ def executeSaga(progress):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
).stdout
|
||||
|
@ -82,7 +82,7 @@ def testDescriptionFile(f):
|
||||
command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
).stdout
|
||||
|
@ -94,7 +94,7 @@ class TauDEMUtils(object):
|
||||
fused_command,
|
||||
shell=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stdin=open(os.devnull),
|
||||
stdin=subprocess.DEVNULL,
|
||||
stderr=subprocess.STDOUT,
|
||||
universal_newlines=True,
|
||||
).stdout
|
||||
|
Loading…
x
Reference in New Issue
Block a user