mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-12 16:32:01 -05:00
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:
1 parent
026b1b5307
commit
65e3b9edc6
4 files changed
+11
-10
No files matched your search
@@ -20,11 +20,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import StringIO
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from six import StringIO
|
||||
|
||||
try:
|
||||
from pyrad import packet
|
||||
from pyrad.dictionary import Dictionary
|
||||
@@ -40,7 +41,7 @@ ATTRIBUTE User-Password 2 string
|
||||
ATTRIBUTE NAS-Identifier 32 string
|
||||
"""
|
||||
|
||||
dct = Dictionary(StringIO.StringIO(DICTIONARY))
|
||||
dct = Dictionary(StringIO(DICTIONARY))
|
||||
|
||||
proc = subprocess.Popen(["./ipa-otpd", sys.argv[1]],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import shlex
|
||||
import sys
|
||||
import contextlib
|
||||
import StringIO
|
||||
|
||||
import nose
|
||||
import six
|
||||
from six import StringIO
|
||||
|
||||
from ipatests import util
|
||||
from ipalib import api, errors
|
||||
@@ -41,7 +41,7 @@ class TestCLIParsing(object):
|
||||
def fake_stdin(self, string_in):
|
||||
"""Context manager that temporarily replaces stdin to read a string"""
|
||||
old_stdin = sys.stdin
|
||||
sys.stdin = StringIO.StringIO(string_in)
|
||||
sys.stdin = StringIO(string_in)
|
||||
yield
|
||||
sys.stdin = old_stdin
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -25,10 +25,10 @@ import re
|
||||
import collections
|
||||
import itertools
|
||||
import time
|
||||
import StringIO
|
||||
import dns
|
||||
|
||||
import dns
|
||||
from ldif import LDIFWriter
|
||||
from six import StringIO
|
||||
|
||||
from ipapython import ipautil
|
||||
from ipaplatform.paths import paths
|
||||
@@ -780,7 +780,7 @@ def install_clients(servers, clients):
|
||||
def _entries_to_ldif(entries):
|
||||
"""Format LDAP entries as LDIF"""
|
||||
lines = []
|
||||
io = StringIO.StringIO()
|
||||
io = StringIO()
|
||||
writer = LDIFWriter(io)
|
||||
for entry in entries:
|
||||
writer.unparse(str(entry.dn), dict(entry))
|
||||
|
||||
Reference in new issue
Block a user