Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-107944: Improve error message for getargs with bad keyword arguments#114792
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
} | ||
else { | ||
PyErr_Format(PyExc_TypeError, | ||
"%.200s%s got an unexpected keyword argument '%S'", |
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.
I made this error message match the one in ceval.c
I still need to do the |
@@ -987,6 +987,14 @@ def case_change_over_substitution(BLuch=None, Luch = None, fluch = None): | |||
with self.check_suggestion_includes(suggestion): | |||
func(bluch=None) | |||
def test_unexpected_keyword_suggestion_via_getargs(self): |
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.
Do you mind adding a explicit test for when the suggestion fails (the 'else' case in the conditionalhere
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.
Thanks for the review! I added this test.
I also made a similar edit in thevgetargskeywords
code path and added tests.
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.
Very good work@hauntsaninja! Thanks for working on this
This looks great, I left some nit but please feel free to ignore
Uh oh!
There was an error while loading.Please reload this page.