make config-test py2-compatible

This commit is contained in:
Thor77 2016-05-08 21:42:28 +02:00
parent a25a596d02
commit b3427ec785
1 changed files with 6 additions and 2 deletions

View File

@ -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)