mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 04:36:52 +00:00
Fixes handling of empty lists by Application
`Application.parse_preliminary_options_and_args` was previously, against expectations, treating empty lists passed as the `argv` argument the same way it treated `None`s. This has been addressed and the correct behavior tested for in a unit test of the `Application` class. See issue #518 for details.
This commit is contained in:
parent
88caf5ac48
commit
16ca17388a
2 changed files with 11 additions and 1 deletions
|
|
@ -122,7 +122,7 @@ class Application(object):
|
|||
# do not need to worry and we can continue. If it is, we successfully
|
||||
# defer printing the version until just a little bit later.
|
||||
# Similarly we have to defer printing the help text until later.
|
||||
args = (argv or sys.argv)[:]
|
||||
args = (argv if argv is not None else sys.argv)[:]
|
||||
try:
|
||||
args.remove("--version")
|
||||
except ValueError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue