Ubuntu Pastebin

Paste from csmith at Wed, 31 May 2017 19:47:47 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index 9ff1599..e78abce 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -19,10 +19,6 @@ try:
     from contextlib import ExitStack
 except ImportError:
     from contextlib2 import ExitStack
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from io import StringIO
 
 from cloudinit import helpers as ch
 from cloudinit import util
@@ -102,7 +98,7 @@ class CiTestCase(TestCase):
         if self.with_logs:
             # Create a log handler so unit tests can search expected logs.
             logger = logging.getLogger()
-            self.logs = StringIO()
+            self.logs = six.StringIO()
             handler = logging.StreamHandler(self.logs)
             self.old_handlers = logger.handlers
             logger.handlers = [handler]
Download as text