Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make generator_cmd in bloom-generate required #619

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pseyfert
Copy link

This handles when bloom-generate gets called without argument and
aborts processing.
This fixes #580.

This handles when `bloom-generate` gets called without argument and
aborts processing.
This fixes ros-infrastructure#580.
@pseyfert
Copy link
Author

pseyfert commented Feb 24, 2021

FTR: my original commit added add_subparsers(..., required=True). That kwarg appears to be available starting in python 3.7 https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_subparsers
i.e. on ubuntu 18.04 LTS (where python3 is at 3.6.9) that fix would have broken bloom generate.

following https://bugs.python.org/issue9253#msg186387
python 3.6 needs this fix as

subparser = add_subparsers(...)
subparser.required = True # compatible with python 3.6

instead of

subparser = add_subparsers(... required=True) # incompatible with python3.6 and 2.7

In python 2.7 add_subparsers already behaves by default like the python 3 version with required=True. (similar to python 3.6, using a kwarg would break processing on python 2.7. setting the required attribute of subparser doesn't break)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bloom-generate crashes with AttributeError
1 participant