mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 04:48:00 +01:00
Merge from 1.6 branch.
This commit is contained in:
@@ -95,6 +95,10 @@ def Run(cmd, include_stderr=False, return_pipe=False, return_obj=False):
|
||||
else:
|
||||
err = None
|
||||
fds = False
|
||||
if return_obj:
|
||||
std_in = PIPE
|
||||
else:
|
||||
std_in = None
|
||||
|
||||
# We need to make sure that the results of the command we run
|
||||
# are in English, so we set up a temporary environment.
|
||||
@@ -105,8 +109,8 @@ def Run(cmd, include_stderr=False, return_pipe=False, return_obj=False):
|
||||
tmpenv["LANG"] = __LANG
|
||||
|
||||
try:
|
||||
f = Popen(cmd, shell=False, stdout=PIPE, stderr=err, close_fds=fds,
|
||||
cwd='/', env=tmpenv)
|
||||
f = Popen(cmd, shell=False, stdout=PIPE, stdin=std_in, stderr=err,
|
||||
close_fds=fds, cwd='/', env=tmpenv)
|
||||
except OSError, e:
|
||||
print "Running command %s failed: %s" % (str(cmd), str(e))
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user