From: W. Trevor King Date: Fri, 24 Feb 2012 19:25:21 +0000 (-0500) Subject: Avoid generating another StringIO instance in StringInputOutput.get_stdout(). X-Git-Tag: 1.1.0~164 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b2b120d0adbb9522509e366c37b7f8c983858f54;p=be.git Avoid generating another StringIO instance in StringInputOutput.get_stdout(). --- 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):