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

antsibull-docs: fix --help #384

Merged
merged 1 commit into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/384-help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "Work around Python argparse bug by using vendored class for all Python versions until the bug is fixed in argparse. This makes ``--help`` work for all antsibull-docs subcommands (https://github.com/ansible-community/antsibull/pull/384)."
7 changes: 6 additions & 1 deletion src/antsibull/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def _dummy():
#: code that we've copied from the upstream code.
from .vendored._argparse_booleanoptionalaction import BooleanOptionalAction
else:
from argparse import BooleanOptionalAction
# As long as https://bugs.python.org/issue46080 is not fixed, still use vendored version so
# that users can actually use `--help` for affected subcommands. Once that is fixed and
# included in released Python versions, we can adjust the sys.version_info check above.
#
# from argparse import BooleanOptionalAction
from .vendored._argparse_booleanoptionalaction import BooleanOptionalAction

__all__ = ('BooleanOptionalAction', 'asyncio_run', 'best_get_loop', 'create_task', 'metadata')