Use subprocess instead of Popen2. fixes #3369
This commit is contained in:
parent
545eb1ec33
commit
7f639f145d
1 changed files with 4 additions and 5 deletions
|
@ -756,11 +756,10 @@ def get_os_info():
|
||||||
full_path_to_executable = is_in_path(executable, return_abs_path = True)
|
full_path_to_executable = is_in_path(executable, return_abs_path = True)
|
||||||
if full_path_to_executable:
|
if full_path_to_executable:
|
||||||
command = executable + params
|
command = executable + params
|
||||||
child_stdin, child_stdout = os.popen2(command)
|
p = Popen([command], shell=True, stdin=subprocess.PIPE,
|
||||||
output = temp_failure_retry(child_stdout.readline).strip()
|
stdout=subprocess.PIPE, close_fds=True)
|
||||||
child_stdout.close()
|
p.wait()
|
||||||
child_stdin.close()
|
output = temp_failure_retry(p.stdout.readline).strip()
|
||||||
os.wait()
|
|
||||||
# some distros put n/a in places, so remove those
|
# some distros put n/a in places, so remove those
|
||||||
output = output.replace('n/a', '').replace('N/A', '')
|
output = output.replace('n/a', '').replace('N/A', '')
|
||||||
return output
|
return output
|
||||||
|
|
Loading…
Add table
Reference in a new issue