Skip to content

Commit 0724bdd

Browse files
authored
Update Lib/hashlib.py
1 parent f68ea02 commit 0724bdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/hashlib.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ def __get_openssl_constructor(name):
143143

144144
def __data_argument(funcname, data_sentinel, kwargs):
145145
assert '__data_sentinel' not in kwargs
146-
if 'data' in kwargs and 'string' in kwargs:
146+
if 'data' in kwargs and 'string' in kwargs or (
147+
data_sentinel is not None and ('data' in kwargs or 'string' in kwargs)
148+
):
147149
raise TypeError(f"{funcname}(): 'data' and 'string' are mutually exclusive "
148150
f"and support for 'string' keyword parameter is slated for "
149151
f"removal in a future version.")

0 commit comments

Comments
 (0)