allow the import log path to be None

This commit is contained in:
Adrian Sampson 2012-12-23 18:06:55 -08:00
parent 123189b393
commit 392f9861e0
2 changed files with 6 additions and 3 deletions

View file

@ -622,9 +622,8 @@ def import_files(lib, paths, query):
raise ui.UserError("can't be both quiet and timid")
# Open the log.
logpath = config['import']['log'].as_filename()
if logpath:
logpath = normpath(logpath)
if config['import']['log'].get() is not None:
logpath = config['import']['log'].as_filename()
try:
logfile = open(syspath(logpath), 'a')
except IOError:

View file

@ -319,6 +319,10 @@ class ConfigView(object):
is relative to the current working directory.
"""
path, source = self.first()
if not isinstance(path, BASESTRING):
raise ConfigTypeError('{0} must be a filename, not {1}'.format(
self.name, type(path).__name__
))
path = os.path.expanduser(STRING(path))
if source.default: