Commit 6698ed80 authored by Florian Duraffourg's avatar Florian Duraffourg Committed by louiz’

Redirect stderr to /dev/null when executing a command

fix #2545
parent c1803944
......@@ -25,6 +25,12 @@ import subprocess
import shlex
import logging
from subprocess import DEVNULL # Only in python >= 3.3
except ImportError:
import os
DEVNULL = open(os.devnull, 'wb')
log = logging.getLogger(__name__)
class Executor(threading.Thread):
......@@ -51,7 +57,7 @@ class Executor(threading.Thread):
def run(self):
log.debug('executing %s', self.command)
stdout = None
stdout = DEVNULL
if self.filename:
stdout = open(self.filename, self.redirection_mode)
......@@ -59,7 +65,7 @@ class Executor(threading.Thread):
log.error('Could not open redirection file: %s', self.filename, exc_info=True)
try:, stdout=stdout), stdout=stdout, stderr=DEVNULL)
if self.remote:
import traceback
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment