Use six.Stringio instead of StringIO.StringIO

The StringIO class was moved to the io module.
(In Python 2, io.StringIO is available, but is Unicode-only.)

Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Petr Viktorin
2015-09-14 14:52:48 +02:00
committed by Jan Cholasta
parent 026b1b5307
commit 65e3b9edc6
4 changed files with 11 additions and 10 deletions

View File

@@ -19,10 +19,10 @@
import sys
import contextlib
import StringIO
from nose.tools import assert_raises # pylint: disable=E0611
import six
from six import StringIO
from ipalib import api, errors
from ipalib.plugins.user import user_add
@@ -45,8 +45,8 @@ class CLITestContext(object):
def __enter__(self):
self.old_streams = sys.stdout, sys.stderr
self.stdout_fileobj = sys.stdout = StringIO.StringIO()
self.stderr_fileobj = sys.stderr = StringIO.StringIO()
self.stdout_fileobj = sys.stdout = StringIO()
self.stderr_fileobj = sys.stderr = StringIO()
return self
def __exit__(self, exc_type, exc_value, traceback):