summaryrefslogtreecommitdiff
path: root/tests/test_gzipper.py
diff options
context:
space:
mode:
authorCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:12 +0100
committerCyril Roelandt <cyril.roelandt@enovance.com>2014-03-18 12:49:12 +0100
commit674ae7718bc06a8b8c8b658075bf82c8198fb632 (patch)
tree0075bace24ead7f03ae7cb18935e4c707f71a860 /tests/test_gzipper.py
parent3cdb7e4227cbaad690b1c1557c03fa6da0decc36 (diff)
downloadpaste-674ae7718bc06a8b8c8b658075bf82c8198fb632.tar.gz
Python 3: use new names of standard library modules
Use "try/except ImportError" to try Python 2 and Python 3 names.
Diffstat (limited to 'tests/test_gzipper.py')
-rw-r--r--tests/test_gzipper.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_gzipper.py b/tests/test_gzipper.py
index 0832700..4f929b0 100644
--- a/tests/test_gzipper.py
+++ b/tests/test_gzipper.py
@@ -1,6 +1,7 @@
from paste.fixture import TestApp
from paste.gzipper import middleware
-import gzip, cStringIO
+import gzip
+from six.moves import cStringIO as StringIO
def simple_app(environ, start_response):
start_response('200 OK', [('content-type', 'text/plain')])
@@ -14,5 +15,5 @@ def test_gzip():
'/', extra_environ=dict(HTTP_ACCEPT_ENCODING='gzip'))
assert int(res.header('content-length')) == len(res.body)
assert res.body != 'this is a test'
- actual = gzip.GzipFile(fileobj=cStringIO.StringIO(res.body)).read()
+ actual = gzip.GzipFile(fileobj=StringIO(res.body)).read()
assert actual == 'this is a test'