From 03c1395c0153a075f6661864d48fc81dc25404da Mon Sep 17 00:00:00 2001 From: Manuel Ebert Date: Fri, 19 Jul 2013 13:09:33 +0200 Subject: [PATCH] Python 3 compatibility for tests --- features/steps/core.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/features/steps/core.py b/features/steps/core.py index 4b57b47e..130fe5b4 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -3,7 +3,10 @@ from jrnl import jrnl import os import sys import json -import StringIO +try: + from io import StringIO +except ImportError: + from cStringIO import StringIO def read_journal(journal_name="default"): with open(jrnl.CONFIG_PATH) as config_file: @@ -22,7 +25,7 @@ def set_config(context, config_file): def run_with_input(context, command, inputs=None): text = inputs or context.text args = command.split()[1:] - buffer = StringIO.StringIO(text.strip()) + buffer = StringIO(text.strip()) jrnl.util.STDIN = buffer jrnl.cli(args)