From d4b8f49b66ca725ce7f32c438c98d17c4e6f2316 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sun, 24 Jul 2016 20:07:26 -0500 Subject: Stop checking for string option type There's no need to explicitly check for a string type when parsing the configuration file. When it's neither an integer or a boolean, the only value it can logically be is string-like. Closes gh-561 --- pycodestyle.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pycodestyle.py b/pycodestyle.py index 3ee688b..ea367f7 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -2149,13 +2149,12 @@ def read_config(options, args, arglist, parser): opt_type = option_list[normalized_opt] if opt_type in ('int', 'count'): value = config.getint(pep8_section, opt) - elif opt_type == 'string': + elif opt_type in ('store_true', 'store_false'): + value = config.getboolean(pep8_section, opt) + else: value = config.get(pep8_section, opt) if normalized_opt == 'exclude': value = normalize_paths(value, local_dir) - else: - assert opt_type in ('store_true', 'store_false') - value = config.getboolean(pep8_section, opt) setattr(new_options, normalized_opt, value) # Third, overwrite with the command-line options -- cgit v1.2.1