From 7f69f6a769aff932475b44bda75a2881382d26a8 Mon Sep 17 00:00:00 2001 From: Jeremy Carbaugh Date: Sun, 11 Mar 2012 23:17:02 -0700 Subject: [PATCH] use cStringIO on Python 2.x, io.StringIO on 3.x --- saucebrush/tests/emitters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/saucebrush/tests/emitters.py b/saucebrush/tests/emitters.py index ea4e282..612cd8e 100644 --- a/saucebrush/tests/emitters.py +++ b/saucebrush/tests/emitters.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals from contextlib import closing -from io import BytesIO, StringIO +from io import StringIO import unittest from saucebrush.emitters import DebugEmitter, CSVEmitter, CountEmitter @@ -16,8 +16,8 @@ class EmitterTestCase(unittest.TestCase): def test_csv_emitter(self): try: - import cStringIO # if Python 2.x then use BytesIO - io = BytesIO() + import cStringIO # if Python 2.x then use old cStringIO + io = cStringIO.StringIO() except: io = StringIO() # if Python 3.x then use StringIO