Message91808
I think it is useful, at least for me, to add an argument, default, to
[Safe,Raw]ConfigParser.get that, if present, will be returned if the
methid fails to return the value.
That is, instead of rasing an exception, return default, if present.
It could be done overriding the get method in SafeConfigParser,
something like this:
class SafeConfigParser(ConfigParser):
def get(self, section, option, raw=False, vars=None, **kwds):
try:
return super().get(section, option, raw, vars)
except Exception as exc:
if "default" in kwds:
return kwds["default"]
raise exc |
|
Date |
User |
Action |
Args |
2009-08-21 08:57:57 | jjdominguezm | set | recipients:
+ jjdominguezm |
2009-08-21 08:57:57 | jjdominguezm | set | messageid: <1250845077.86.0.224640008074.issue6751@psf.upfronthosting.co.za> |
2009-08-21 08:57:56 | jjdominguezm | link | issue6751 messages |
2009-08-21 08:57:55 | jjdominguezm | create | |
|