提交 b7c7c258 编写于 作者: A Air9 提交者: Gitee

fix bug of failing to get CPU nums with LANG=zh_CN.UTF8

上级 f5395cec
......@@ -35,7 +35,7 @@ class CPU:
def get_info(self):
cmd = Command("lscpu")
try:
nums = cmd.get_str('CPU\(s\):\s+(?P<cpus>\d+)', 'cpus', False)
nums = cmd.get_str('^CPU\S*:\s+(?P<cpus>\d+)$', 'cpus', False)
except:
return False
self.nums = int(nums)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册