def make_subprocess(cmdline, stdout=False, stderr=False, stdin=False, universal_newlines=False):
 cmdline = cmdline.encode('ascii')
 logging.info(("Running cmd '%s'" % cmdline))
 kwargs = {}
 kwargs['stdout'] = ((stdout and subprocess.PIPE) or None)
 kwargs['stderr'] = ((stderr and subprocess.PIPE) or None)
 kwargs['stdin'] = ((stdin and subprocess.PIPE) or None)
 kwargs['universal_newlines'] = universal_newlines
 args = shlex.split(cmdline)
 logging.info(("Running args '%s'" % args))
 proc = subprocess.Popen(args, **kwargs)
 return proc

def make_subprocess ( cmdline , stdout = False , stderr = False , stdin = False , universal_newlines = False ) : cmdline = cmdline . encode ( 'ascii' ) logging . info ( ( "Running cmd '%s'" % cmdline ) ) kwargs = { } kwargs [ 'stdout' ] = ( ( stdout and subprocess . PIPE ) or None ) kwargs [ 'stderr' ] = ( ( stderr and subprocess . PIPE ) or None ) kwargs [ 'stdin' ] = ( ( stdin and subprocess . PIPE ) or None ) kwargs [ 'universal_newlines' ] = universal_newlines args = shlex . split ( cmdline ) logging . info ( ( "Running args '%s'" % args ) ) proc = subprocess . Popen ( args , ** kwargs ) return proc
make a subprocess according to the given command-line string .