提交 c31d0cb6 编写于 作者: S Simon Glass

patman: Use bytearray instead of string

If the process outputs a lot of data on stdout this can be quite slow,
since the bytestring is regenerated each time. Use a bytearray instead.
Signed-off-by: NSimon Glass <sjg@chromium.org>
上级 43332d88
......@@ -169,11 +169,11 @@ class Popen(subprocess.Popen):
self.stdin.close()
if self.stdout:
read_set.append(self.stdout)
stdout = b''
stdout = bytearray()
if self.stderr and self.stderr != self.stdout:
read_set.append(self.stderr)
stderr = b''
combined = b''
stderr = bytearray()
combined = bytearray()
input_offset = 0
while read_set or write_set:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册