From 20ddd842b7a2f9d31502da11c9358c990282d8e6 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 25 May 2018 12:47:51 -0400 Subject: [PATCH] klippy: Fix detection of mixed case section names If a section name had mixed case it would cause an incorrect error during the section/option config checking. Signed-off-by: Kevin O'Connor --- klippy/klippy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/klippy/klippy.py b/klippy/klippy.py index b05bcb12f..624e78786 100644 --- a/klippy/klippy.py +++ b/klippy/klippy.py @@ -212,12 +212,12 @@ class Printer: m.add_printer_objects(self, config) # Validate that there are no undefined parameters in the config file valid_sections = { s: 1 for s, o in self.all_config_options } - for section in fileconfig.sections(): - section = section.lower() + for section_name in fileconfig.sections(): + section = section_name.lower() if section not in valid_sections and section not in self.objects: raise self.config_error( "Section '%s' is not a valid config section" % (section,)) - for option in fileconfig.options(section): + for option in fileconfig.options(section_name): option = option.lower() if (section, option) not in self.all_config_options: raise self.config_error(