def items(self, section, noreplace=False): items = StrictConfigParser.items(self, section) if noreplace: return items return [(key, replace_gnu_args(value, env=self._env)) for key, value in items]
def get(self, section, option): res = StrictConfigParser.get(self, section, option) return replace_gnu_args(res, env=self._env)
def __init__(self, *args, **kw): StrictConfigParser.__init__(self, *args, **kw) self._env = dict(os.environ)
def test_strict_parser(self): cp = StrictConfigParser() bad_ini = os.path.join(os.path.dirname(__file__), 'bad.ini') self.assertRaises(ValueError, cp.read, bad_ini)