summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-07-24 20:07:26 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2016-07-24 20:07:26 -0500
commitd4b8f49b66ca725ce7f32c438c98d17c4e6f2316 (patch)
treed99bb3e895bb0f79d17d7e9ff6c9690a9b586850
parent0babee523197a3a2f6d8dd9e0f5ab2f6166b0ce5 (diff)
downloadpep8-d4b8f49b66ca725ce7f32c438c98d17c4e6f2316.tar.gz
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
-rwxr-xr-xpycodestyle.py7
1 files 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