summaryrefslogtreecommitdiff
path: root/pep8.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2014-05-05 20:09:19 +0200
committerFlorent Xicluna <florent.xicluna@gmail.com>2014-05-05 20:09:19 +0200
commit3beebfb0be9df325629ed249bd5a9576ffe79b2e (patch)
tree0e443e1f9f0844aee9dcbc5acde43996a8819029 /pep8.py
parent047b7fdb07ebde0a54661bf5d2aa9a9831c83d6f (diff)
downloadpep8-3beebfb0be9df325629ed249bd5a9576ffe79b2e.tar.gz
Do not exit when an option in setup.cfg / tox.ini is not recognized
Diffstat (limited to 'pep8.py')
-rwxr-xr-xpep8.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/pep8.py b/pep8.py
index 0671ac7..bc91137 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1837,12 +1837,11 @@ def read_config(options, args, arglist, parser):
# Second, parse the configuration
for opt in config.options(pep8_section):
+ if opt.replace('_', '-') not in parser.config_options:
+ print(" unknown option '%s' ignored" % opt)
+ continue
if options.verbose > 1:
print(" %s = %s" % (opt, config.get(pep8_section, opt)))
- if opt.replace('_', '-') not in parser.config_options:
- print("Unknown option: '%s'\n not in [%s]" %
- (opt, ' '.join(parser.config_options)))
- sys.exit(1)
normalized_opt = opt.replace('-', '_')
opt_type = option_list[normalized_opt]
if opt_type in ('int', 'count'):