import logging as log
+class ConfigError(Exception):
+ """
+ An exception thrown when something is wrong with the config.
+ This is not thrown by the config module, but it is meant to be
+ thrown by handlers when they find something wrong with the
+ configuration contents.
+ """
+ pass
+
def get_global_config(opts):
"""
Returns the global configuration, in a SafeConfigParser object.
if not parser.has_section(section):
parser.add_section(section)
for option, value in options.items():
- parser.set(section, option, value)
+ # Interpret None as "no default", since ConfigParser doesn't
+ # like non-string values.
+ if not value is None:
+ parser.set(section, option, value)