We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f68ea02 commit 0724bddCopy full SHA for 0724bdd
Lib/hashlib.py
@@ -143,7 +143,9 @@ def __get_openssl_constructor(name):
143
144
def __data_argument(funcname, data_sentinel, kwargs):
145
assert '__data_sentinel' not in kwargs
146
- if 'data' in kwargs and 'string' in kwargs:
+ if 'data' in kwargs and 'string' in kwargs or (
147
+ data_sentinel is not None and ('data' in kwargs or 'string' in kwargs)
148
+ ):
149
raise TypeError(f"{funcname}(): 'data' and 'string' are mutually exclusive "
150
f"and support for 'string' keyword parameter is slated for "
151
f"removal in a future version.")
0 commit comments