correct location of logging.debug message, suppress None in cfg

This commit is contained in:
Martin A. Brown 2016-02-22 20:23:59 -08:00
parent 25add163cb
commit b62b732a23
1 changed files with 4 additions and 1 deletions

View File

@ -510,8 +510,9 @@ class CascadingConfig(object):
self.userconfig_extras = extras
def set_config(self, order=None):
if order is None:
if order is not None:
logger.debug("Installing custom resolution order %r", order)
else:
order = self.order
sources = [(x, getattr(self, x)) for x in order]
sources.reverse()
@ -548,6 +549,8 @@ class CascadingConfig(object):
field = CFGSEP.join(parts[2:])
if not cfg.has_section(sect):
cfg.add_section(sect)
if v is None:
v = ''
if isinstance(v, (list, tuple)):
vstr = ',\n'.join([str(x) for x in v])
cfg.set(sect, field, vstr)