Skip to content

Commit

Permalink
Python 3: io.StringIO
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Oct 21, 2017
1 parent 1a71281 commit 6fa480b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/zope/app/server/tests/test_ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@
"""
import unittest

try:
from cStringIO import StringIO
except ImportError:
from io import StringIO


class Tests(unittest.TestCase):

def test_ftp(self):
from ZODB.tests.util import DB
from zope.app.server.ftp import FTPRequestFactory
from cStringIO import StringIO
db = DB()
factory = FTPRequestFactory(db)
request = factory(StringIO(''), {'credentials': None, 'path': '/'})
Expand Down
6 changes: 5 additions & 1 deletion src/zope/app/server/tests/test_mkzopeinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
import tempfile
import unittest
from contextlib import contextmanager
from StringIO import StringIO

from zope.app.server import mkzopeinstance

try:
from cStringIO import StringIO
except ImportError:
from io import StringIO


@contextmanager
def capture_output(stdout=None, stderr=None):
Expand Down

0 comments on commit 6fa480b

Please sign in to comment.