Skip to content

Commit 3beebfb

Browse files
committed
Do not exit when an option in setup.cfg / tox.ini is not recognized
1 parent 047b7fd commit 3beebfb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Bug fixes:
99

1010
* Skip the traceback on "Broken pipe" signal. (Issue #275)
1111

12+
* Do not exit when an option in ``setup.cfg`` or ``tox.ini``
13+
is not recognized.
14+
1215

1316
1.5.6 (2014-04-14)
1417
------------------

pep8.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,12 +1837,11 @@ def read_config(options, args, arglist, parser):
18371837

18381838
# Second, parse the configuration
18391839
for opt in config.options(pep8_section):
1840+
if opt.replace('_', '-') not in parser.config_options:
1841+
print(" unknown option '%s' ignored" % opt)
1842+
continue
18401843
if options.verbose > 1:
18411844
print(" %s = %s" % (opt, config.get(pep8_section, opt)))
1842-
if opt.replace('_', '-') not in parser.config_options:
1843-
print("Unknown option: '%s'\n not in [%s]" %
1844-
(opt, ' '.join(parser.config_options)))
1845-
sys.exit(1)
18461845
normalized_opt = opt.replace('-', '_')
18471846
opt_type = option_list[normalized_opt]
18481847
if opt_type in ('int', 'count'):

0 commit comments

Comments
 (0)