diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2014-05-05 20:09:19 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2014-05-05 20:09:19 +0200 |
commit | 3beebfb0be9df325629ed249bd5a9576ffe79b2e (patch) | |
tree | 0e443e1f9f0844aee9dcbc5acde43996a8819029 | |
parent | 047b7fdb07ebde0a54661bf5d2aa9a9831c83d6f (diff) | |
download | pep8-3beebfb0be9df325629ed249bd5a9576ffe79b2e.tar.gz |
Do not exit when an option in setup.cfg / tox.ini is not recognized
-rw-r--r-- | CHANGES.txt | 3 | ||||
-rwxr-xr-x | pep8.py | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index e12f89d..d8571b5 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,9 @@ Bug fixes: * Skip the traceback on "Broken pipe" signal. (Issue #275) +* Do not exit when an option in ``setup.cfg`` or ``tox.ini`` + is not recognized. + 1.5.6 (2014-04-14) ------------------ @@ -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'): |