Python 3 ConfigParser compatibility.

This commit is contained in:
Dan Helfman 2014-12-01 20:26:19 -08:00
parent 45c6541266
commit 69971cd7e2
2 changed files with 3 additions and 3 deletions

View file

@ -1,5 +1,5 @@
from collections import namedtuple
from ConfigParser import SafeConfigParser
from ConfigParser import ConfigParser
CONFIG_SECTION_LOCATION = 'location'
@ -19,7 +19,7 @@ def parse_configuration(config_filename):
Given a config filename of the expected format, return the parse configuration as a tuple of
(LocationConfig, RetentionConfig). Raise if the format is not as expected.
'''
parser = SafeConfigParser()
parser = ConfigParser()
parser.read((config_filename,))
section_names = parser.sections()
expected_section_names = CONFIG_FORMAT.keys()

View file

@ -8,7 +8,7 @@ def insert_mock_parser(section_names):
parser = flexmock()
parser.should_receive('read')
parser.should_receive('sections').and_return(section_names)
flexmock(module).SafeConfigParser = parser
flexmock(module).ConfigParser = parser
return parser