Skip to content

Commit f269c4d

Browse files
Catch error when the section is unrecognised
1 parent 4e3ee44 commit f269c4d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pylint/config/option_manager_mixin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,11 @@ def load_config_file(self):
311311
options provider)"""
312312
parser = self.cfgfile_parser
313313
for section in parser.sections():
314-
for option, value in parser.items(section):
314+
try:
315+
items = parser.items(section)
316+
except ValueError:
317+
print(f"Unexpected value '{section}' is not a recognized option.")
318+
for option, value in items:
315319
try:
316320
self.global_set_option(option, value)
317321
except (KeyError, optparse.OptionError):

0 commit comments

Comments
 (0)