8000 gh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures by picnixz · Pull Request #134713 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-134696: align OpenSSL and HACL*-based hash functions constructors AC signatures #134713

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

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update Lib/hashlib.py
  • Loading branch information
picnixz authored May 27, 2025
commit 569d63e88e31ea814bf43fc7679ef5577b195095
9 changes: 5 additions & 4 deletions Lib/hashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ def __get_openssl_constructor(name):

def __data_argument(funcname, data_sentinel, kwargs):
if '__data_sentinel' in kwargs:
raise TypeError("'__data_sentinel' is not a valid keyword argument")
raise TypeError(f"{funcname}(): got an unexpected keyword "
f"parameter '__data_sentinel'")
if 'data' in kwargs and 'string' in kwargs:
raise TypeError("'data' and 'string' are mutually exclusive "
"and support for 'string' keyword parameter "
"is slated for removal in a future version.")
raise TypeError(f"{funcname}(): 'data' and 'string' are mutually exclusive "
f"and support for 'string' keyword parameter is slated for "
f"removal in a future version.")
if data_sentinel is None:
if 'data' in kwargs:
# new(name, data=...)
Expand Down
Loading
0