Forwarding args for SafePopen to Popen directly

This commit is contained in:
Strahinja Val Markovic 2013-12-24 18:53:23 -08:00
parent 7fac081bea
commit b3f70a6c95

View File

@ -171,17 +171,13 @@ def ForceSemanticCompletion( request_data ):
return ( 'force_semantic' in request_data and return ( 'force_semantic' in request_data and
bool( request_data[ 'force_semantic' ] ) ) bool( request_data[ 'force_semantic' ] ) )
def SafePopen( args, bufsize = 0, executable = None, stdin = None,
stdout = None, stderr = None, preexec_fn = None, # A wrapper for subprocess.Popen that works around a Popen bug on Windows.
close_fds = False, shell = False, cwd = None, env = None, def SafePopen( *args, **kwargs ):
universal_newlines = False, startupinfo = None, if kwargs.get( 'stdin', '' ) is None:
creationflags = 0 ):
if stdin is None:
# We need this on Windows otherwise bad things happen. See issue #637. # We need this on Windows otherwise bad things happen. See issue #637.
stdin = subprocess.PIPE if OnWindows() else None kwargs[ 'stdin' ] = subprocess.PIPE if OnWindows() else None
return subprocess.Popen( args, bufsize, executable, stdin, stdout, stderr, return subprocess.Popen( *args, **kwargs )
preexec_fn, close_fds, shell, cwd, env,
universal_newlines, startupinfo, creationflags )