-
Notifications
You must be signed in to change notification settings - Fork 131
[python] fix compatibility with Python 3.14 #464
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,11 +22,12 @@ | |
|
|
||
|
|
||
| class ArgParser(argparse.ArgumentParser): | ||
| def __init__(self, *, prog: str): | ||
| def __init__(self, *, prog: str, **kwargs): | ||
| super().__init__( | ||
| prog=prog, | ||
| allow_abbrev=False, | ||
| formatter_class=argparse.RawTextHelpFormatter | ||
| formatter_class=argparse.RawTextHelpFormatter, | ||
| **kwargs | ||
| ) | ||
|
Comment on lines
24
to
31
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Most likely, usages of This way introduces a new limitation: My proposal in #463 (comment) doesn't have such limitation. Using
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, yes I understand this. I opted to keep this simpler fix because The issue with FootnotesThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggested a change that will ignore these args (as in it'll capture them into variables that are then unused) and added a docstring that explicitly says they'll be ignored. IMO it's cleaner than using |
||
| self._prog = prog | ||
| self._command_subparsers = None | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure I got the spacing right, but if you add these to the parameter list they won't be propagated to kwargs, and then they can be safely ignored (which would address muzimuzhi's comment). I added the docstring to make it clear they will be ignored, but that it's cooperative otherwise