|
24 | 24 | """
|
25 | 25 |
|
26 | 26 | try:
|
27 |
| - from configparser import configparser, NoOptionError, NoSectionError |
| 27 | + from configparser import ConfigParser as configparser, NoOptionError, NoSectionError |
28 | 28 | except ImportError:
|
29 | 29 | from ConfigParser import SafeConfigParser as configparser, NoOptionError, NoSectionError
|
30 | 30 |
|
31 | 31 |
|
32 |
| -class simpleconfigparser(configparser, dict): |
| 32 | +class simpleconfigparser(configparser): |
33 | 33 | class Section(dict):
|
34 | 34 | """
|
35 | 35 | Contain the section specific items that can be accessed via object properties
|
@@ -86,15 +86,15 @@ def __init__(self, defaults=None, *args, **kwargs):
|
86 | 86 | configparser.__init__(self, defaults=None, *args, **kwargs)
|
87 | 87 | # Improved defaults handling
|
88 | 88 | if isinstance(defaults, dict):
|
89 |
| - for section, values in defaults.iteritems(): |
| 89 | + for section, values in defaults.items(): |
90 | 90 | # Break out original format defaults was passed in
|
91 | 91 | if not isinstance(values, dict):
|
92 | 92 | break
|
93 | 93 |
|
94 | 94 | if section not in self.sections():
|
95 | 95 | self.add_section(section)
|
96 | 96 |
|
97 |
| - for name, value in values.iteritems(): |
| 97 | + for name, value in values.items(): |
98 | 98 | self.set(section, name, str(value))
|
99 | 99 |
|
100 | 100 | def __getitem__(self, name):
|
@@ -126,6 +126,6 @@ def set(self, section, option, value=None):
|
126 | 126 | def get(self, section, option, raw=False, vars=None):
|
127 | 127 | try:
|
128 | 128 | # Strip out quotes from the edges
|
129 |
| - return configparser.get(self, section, option, raw, vars).strip('"\'') |
| 129 | + return configparser.get(self, section, option, raw=raw, vars=vars).strip('"\'') |
130 | 130 | except NoOptionError:
|
131 | 131 | return None
|
0 commit comments