autotest: use StringIO correctly

This commit is contained in:
Andy Piper 2020-09-05 08:55:31 +01:00 committed by Peter Barker
parent 5c554221c7
commit 0b9d9fc284
1 changed files with 1 additions and 1 deletions

View File

@ -5386,7 +5386,7 @@ Also, ignores heartbeats not from our target system'''
class Capturing(list):
def __enter__(self):
self._stderr = sys.stderr
sys.stderr = self._stringio = StringIO()
sys.stderr = self._stringio = StringIO.StringIO()
return self
def __exit__(self, *args):
self.extend(self._stringio.getvalue().splitlines())