Index: ConfigParser.py =================================================================== --- ConfigParser.py (revision 53588) +++ ConfigParser.py (working copy) @@ -323,11 +323,12 @@ def getfloat(self, section, option): return self._get(section, float, option) + def getboolean(self, section, option): + return self._get(section, self._bool_conv, option) + _boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False} - - def getboolean(self, section, option): - v = self.get(section, option) + def _bool_conv(self, v): if v.lower() not in self._boolean_states: raise ValueError, 'Not a boolean: %s' % v return self._boolean_states[v.lower()]