提交 e1a035de 编写于 作者: C chunfuwen

Python 3: fix re.findall() using string pattern on a bytes-like object

re.findall(regexp, out) or re.search need regexp and out in the same type:st
currently regexp is string,but out is bytes,which cause exception thrown whe
Fix this issue by transfering out into string forcedly
Signed-off-by: Nchunfuwen <chwen@redhat.com>
上级 3a60cc5b
......@@ -408,7 +408,7 @@ class YumBackend(RpmBackend):
y_cmd = executable + ' --version | head -1'
cmd_result = process.run(y_cmd, ignore_status=True,
verbose=False, shell=True)
out = cmd_result.stdout.strip()
out = cmd_result.stdout_text.strip()
try:
ver = re.findall(r'\d*.\d*.\d*', out)[0]
except IndexError:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册