mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-27 03:00:36 +00:00
Check config file has sections
RawConfigParser does not raise an error if the file is empty.
This commit is contained in:
parent
f5ba538184
commit
fa2bb932e6
1 changed files with 3 additions and 0 deletions
|
|
@ -57,6 +57,9 @@ class LCConfigParser(RawConfigParser):
|
|||
assert isinstance(files, list), "Invalid file list %r" % files
|
||||
try:
|
||||
self.read_ok = super().read(files)
|
||||
if not self.sections():
|
||||
raise LinkCheckerError(
|
||||
_("configuration files %s contain no sections.") % files)
|
||||
if len(self.read_ok) < len(files):
|
||||
failed_files = set(files) - set(self.read_ok)
|
||||
log.warn(
|
||||
|
|
|
|||
Loading…
Reference in a new issue