From b2b120d0adbb9522509e366c37b7f8c983858f54 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 24 Feb 2012 14:25:21 -0500 Subject: Avoid generating another StringIO instance in StringInputOutput.get_stdout(). --- libbe/command/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libbe/command/base.py b/libbe/command/base.py index 4e1e41f..54de8c2 100644 --- a/libbe/command/base.py +++ b/libbe/command/base.py @@ -483,8 +483,7 @@ class StringInputOutput (InputOutput): def get_stdout(self): ret = self.stdout.getvalue() - self.stdout = StringIO.StringIO() # clear stdout for next read - self.stdin.encoding = 'utf-8' + self.stdout.truncate(size=0) return ret class UnconnectedStorageGetter (object): -- cgit