test/unittest_cwctl.py
changeset 10721 e9abbaa835f5
parent 10600 180aa08cad48
--- a/test/unittest_cwctl.py	Mon Sep 21 17:51:58 2015 +0200
+++ b/test/unittest_cwctl.py	Mon Sep 21 17:54:15 2015 +0200
@@ -18,7 +18,10 @@
 import sys
 import os
 from os.path import join
-from cStringIO import StringIO
+from io import StringIO, BytesIO
+
+from six import PY2
+
 from logilab.common.testlib import TestCase, unittest_main
 
 from cubicweb.cwconfig import CubicWebConfiguration
@@ -30,7 +33,7 @@
 
 class CubicWebCtlTC(TestCase):
     def setUp(self):
-        self.stream = StringIO()
+        self.stream = BytesIO() if PY2 else StringIO()
         sys.stdout = self.stream
     def tearDown(self):
         sys.stdout = sys.__stdout__