Skip to content

Commit

Permalink
building: Correctly parse --debug= options.
Browse files Browse the repository at this point in the history
Fixes (part of) #3808.
  • Loading branch information
bjones1 committed Oct 18, 2018
1 parent 0b6f1ec commit ea8e55d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions PyInstaller/building/makespec.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ def __add_options(parser):
# If this option is not specified, then its default value is
# an empty list (no debug options selected).
default=[],
# Allow the user to specify one argument.
nargs=1,
# Note that ``nargs`` is omitted. This produces a single item
# not stored in a list, as opposed to list containing one
# item, per `nargs <https://docs.python.org/3/library/argparse.html#nargs>`_.
nargs=None,
# The options specified must come from this list.
choices=DEBUG_ALL_CHOICE + DEBUG_ARGUMENT_CHOICES,
# Append choice, rather than storing them (which would
Expand Down Expand Up @@ -394,7 +396,7 @@ def main(scripts, name=None, onefile=None,
if debug is None:
debug = []
# Translate the ``all`` option.
if DEBUG_ALL_CHOICE in debug:
if DEBUG_ALL_CHOICE[0] in debug:
debug = DEBUG_ARGUMENT_CHOICES

d = {
Expand Down
1 change: 1 addition & 0 deletions news/3808.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Correctly parse the ``--debug=import``, ``--debug=bootloader``, and ``--debug=noarchive`` command-line options.

0 comments on commit ea8e55d

Please sign in to comment.