-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Change from pop
to keys
for reporting proper error message
#2391
Conversation
Cool, can you add a test to avoid this regression in the future please? We use doctests, so adding another entry to the "Examples" is the way. |
Done! |
I'm confused if this actually runs since it'd expect it to require an |
Oh, I saw in the documentation for doctest that |
I think this code originally meant to use (Note to self: This code will be gone anyway with the migration to py3 keyword-only arguments hopefully.) |
pwnlib/util/fiddling.py
Outdated
""" | ||
|
||
cut = kwargs.pop('cut', 'max') | ||
|
||
if kwargs != {}: | ||
raise TypeError("xor() got an unexpected keyword argument '%s'" % kwargs.pop()[0]) | ||
raise TypeError("xor() got an unexpected keyword argument '%s'" % list(kwargs.keys())[0]) |
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.
raise TypeError("xor() got an unexpected keyword argument '%s'" % list(kwargs.keys())[0]) | |
raise TypeError("xor() got an unexpected keyword argument '%s'" % kwargs.popitem()[0]) |
Thank you again! |
Fixes #2390