Felix Laurie von Massenbach <[email protected]> added the comment:
Oops, that was the broken first version. Let's try again:
class MyConfigParser(ConfigParser.RawConfigParser):
def getboolean(self, section, option):
result = self.get(section, option)
try:
trues = ["1", "yes", "true", "on"]
falses = ["0", "no", "false", "off"]
if result.lower() in trues:
return True
if result.lower() in falses:
return False
except AttributeError as err:
if str(err) == "\'bool\' object has no attribute \'lower\'":
return result
raise err
Felix
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue10387>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com