[FIX] tools.misc: win32 compatibility for the new subprocess code
bzr revid: odo@openerp.com-20110119150114-8c5yr38nwaa8yex5
This commit is contained in:
+8
-2
@@ -162,16 +162,22 @@ def exec_pg_command_pipe(name, *args):
|
||||
prog = find_pg_tool(name)
|
||||
if not prog:
|
||||
raise Exception('Couldn\'t find %s' % name)
|
||||
# on win32, passing close_fds=True is not compatible
|
||||
# with redirecting std[in/err/out]
|
||||
pop = subprocess.Popen((prog,) + args, bufsize= -1,
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
close_fds=(os.name=="posix"))
|
||||
return (pop.stdin, pop.stdout)
|
||||
|
||||
def exec_command_pipe(name, *args):
|
||||
prog = find_in_path(name)
|
||||
if not prog:
|
||||
raise Exception('Couldn\'t find %s' % name)
|
||||
# on win32, passing close_fds=True is not compatible
|
||||
# with redirecting std[in/err/out]
|
||||
pop = subprocess.Popen((prog,) + args, bufsize= -1,
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True)
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
close_fds=(os.name=="posix"))
|
||||
return (pop.stdin, pop.stdout)
|
||||
|
||||
#----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user