Просмотр исходного кода

Python 3 ConfigParser compatibility.

Dan Helfman 10 лет назад
Родитель
Сommit
25b78d6de4
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      atticmatic/config.py
  2. 1 1
      atticmatic/tests/unit/test_config.py

+ 2 - 2
atticmatic/config.py

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

+ 1 - 1
atticmatic/tests/unit/test_config.py

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