feat: add alma9 support and fix: rpm python3 compatibility
This commit is contained in:
@ -69,18 +69,13 @@ def shell_run_command(command_str, need_print_all=True, need_print_output=True,
|
|||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
shell=True,
|
shell=True,
|
||||||
close_fds=True)
|
close_fds=True,
|
||||||
|
universal_newlines=True)
|
||||||
while True:
|
while True:
|
||||||
data = ps.stdout.readline()
|
data = ps.stdout.readline()
|
||||||
if data == b'':
|
if not data:
|
||||||
if ps.poll() is not None:
|
if ps.poll() is not None:
|
||||||
break
|
break
|
||||||
# fix: python2->python3 subprocess shell bug
|
|
||||||
# 2023/09/21 jiangxf
|
|
||||||
try:
|
|
||||||
data = data.decode()
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
result["return_message"].append(data)
|
result["return_message"].append(data)
|
||||||
|
|
||||||
if not need_print_all:
|
if not need_print_all:
|
||||||
|
|||||||
Reference in New Issue
Block a user