Skip to content

Commit d4b8f49

Browse files
committed
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
1 parent 0babee5 commit d4b8f49

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pycodestyle.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,13 +2149,12 @@ def read_config(options, args, arglist, parser):
21492149
opt_type = option_list[normalized_opt]
21502150
if opt_type in ('int', 'count'):
21512151
value = config.getint(pep8_section, opt)
2152-
elif opt_type == 'string':
2152+
elif opt_type in ('store_true', 'store_false'):
2153+
value = config.getboolean(pep8_section, opt)
2154+
else:
21532155
value = config.get(pep8_section, opt)
21542156
if normalized_opt == 'exclude':
21552157
value = normalize_paths(value, local_dir)
2156-
else:
2157-
assert opt_type in ('store_true', 'store_false')
2158-
value = config.getboolean(pep8_section, opt)
21592158
setattr(new_options, normalized_opt, value)
21602159

21612160
# Third, overwrite with the command-line options

0 commit comments

Comments
 (0)