From b3427ec7854ff1997803f0ed0a9d4a0ba9052eb6 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Sun, 8 May 2016 21:42:28 +0200 Subject: [PATCH] make config-test py2-compatible --- tsstats/tests/test_config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tsstats/tests/test_config.py b/tsstats/tests/test_config.py index 823e7d0..279b838 100644 --- a/tsstats/tests/test_config.py +++ b/tsstats/tests/test_config.py @@ -1,4 +1,8 @@ -import configparser +try: + from configparser import ConfigParser +except ImportError: + from ConfigParser import ConfigParser + from os import remove from os.path import abspath, exists @@ -11,7 +15,7 @@ configpath = abspath('tsstats/tests/res/test.cfg') def create_config(values, key='General'): - config = configparser.ConfigParser() + config = ConfigParser() config[key] = values with open(configpath, 'w') as configfile: config.write(configfile)