From 16f34794d4cef293c0de97c459e92027fc77ab5f Mon Sep 17 00:00:00 2001 From: ryneeverett Date: Sun, 23 Oct 2016 10:27:37 -0400 Subject: [PATCH] Python3 compatibility for recent code additions. --- bugwarrior/config.py | 2 +- tests/test_config.py | 4 ++-- tests/test_data.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bugwarrior/config.py b/bugwarrior/config.py index 1b2193e98..b3f1d2c20 100644 --- a/bugwarrior/config.py +++ b/bugwarrior/config.py @@ -227,7 +227,7 @@ def get_data_path(config, main_section): data_location = subprocess.check_output( ('grep', '-e', '^' + line_prefix), stdin=tw_show.stdout) tw_show.wait() - data_path = data_location[len(line_prefix):].rstrip() + data_path = data_location[len(line_prefix):].rstrip().decode('utf-8') if not data_path: raise RuntimeError('Unable to determine the data location.') diff --git a/tests/test_config.py b/tests/test_config.py index f27b44d6e..8e802efac 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,7 +1,7 @@ from __future__ import unicode_literals import os -import ConfigParser +import configparser import bugwarrior.config as config @@ -76,7 +76,7 @@ class TestGetDataPath(ConfigTest): def setUp(self): super(TestGetDataPath, self).setUp() - self.config = ConfigParser.RawConfigParser() + self.config = configparser.RawConfigParser() self.config.add_section('general') def assertDataPath(self, expected_datapath): diff --git a/tests/test_data.py b/tests/test_data.py index bdaf88dc1..585825761 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -1,6 +1,6 @@ import os import json -import ConfigParser +import configparser from bugwarrior import data @@ -10,7 +10,7 @@ class TestData(ConfigTest): def setUp(self): super(TestData, self).setUp() - config = ConfigParser.RawConfigParser() + config = configparser.RawConfigParser() config.add_section('general') self.data = data.BugwarriorData(config, 'general')