diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-05-25 12:47:51 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-05-25 12:47:51 -0400 |
commit | 20ddd842b7a2f9d31502da11c9358c990282d8e6 (patch) | |
tree | 03824d6f55b2206169a84d96ba24e24ebca08ea9 /klippy/klippy.py | |
parent | c38a63d4db592177c86046e76d512c9e2a55955b (diff) | |
download | kutter-20ddd842b7a2f9d31502da11c9358c990282d8e6.tar.gz kutter-20ddd842b7a2f9d31502da11c9358c990282d8e6.tar.xz kutter-20ddd842b7a2f9d31502da11c9358c990282d8e6.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/klippy.py')
-rw-r--r-- | klippy/klippy.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/klippy.py b/klippy/klippy.py index b05bcb12..624e7878 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( |