Skip to content

Commit e2a3747

Browse files
committed
fixups
1 parent 5572288 commit e2a3747

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Lib/test/support/hashlib_helper.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def _parse_fullname(fullname, *, strict=False):
2020
return None, None
2121
assert isinstance(fullname, str), fullname
2222
assert fullname.count(".") >= 1, fullname
23-
return fullname.rsplit(".", maxsplit=1)
23+
module_name, member_name = fullname.rsplit(".", maxsplit=1)
24+
return module_name, member_name
2425

2526

2627
def _import_module(module_name, *, strict=False):
@@ -482,7 +483,7 @@ def _iter_hash_func_info(excluded):
482483
assert _HMACINFO_DATABASE.keys() == CANONICAL_DIGEST_NAMES
483484

484485

485-
def get_hmac_info_item(name):
486+
def get_hmac_func_info(name):
486487
info = _HMACINFO_DATABASE[name]
487488
assert isinstance(info, _HashInfoItem), info
488489
return info
@@ -646,7 +647,7 @@ def _openssl_hash(digestname, /, **kwargs):
646647
except ImportError as exc:
647648
raise SkipNoHash(fullname, "openssl") from exc
648649
try:
649-
constructor = getattr(_hashlib, method_name, None)
650+
constructor = getattr(_hashlib, method_name)
650651
except AttributeError as exc:
651652
raise SkipNoHash(fullname, "openssl") from exc
652653
try:
@@ -1017,7 +1018,7 @@ def dummy(data=b'', *, usedforsecurity=True, string=b''):
10171018

10181019
def _block_builtin_hmac_constructor(name):
10191020
"""Block explicit HACL* HMAC constructors."""
1020-
info = get_hmac_info_item(name)
1021+
info = get_hmac_func_info(name)
10211022
assert info.module_name is None or info.module_name == "_hmac", info
10221023
if (wrapped := info.import_member()) is None:
10231024
# function shouldn't exist for this implementation

Lib/test/test_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ def fetch_hash_function(self, name, implementation):
879879
return self.try_import_attribute(fullname)
880880

881881
def fetch_hmac_function(self, name):
882-
target = hashlib_helper.get_hmac_info_item(name)
882+
target = hashlib_helper.get_hmac_func_info(name)
883883
return target.import_member()
884884

885885
def check_openssl_hash(self, name, *, disabled=True):

0 commit comments

Comments
 (0)