Skip to content

Commit f5b3a35

Browse files
committed
less diff
1 parent 96d6de3 commit f5b3a35

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

Lib/test/support/hashlib_helper.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ def fullname(self, implementation):
177177
_EXPLICIT_HMAC_CONSTRUCTORS[HID.shake_256] = None
178178
# Strictly speaking, HMAC-BLAKE is meaningless as BLAKE2 is already a
179179
# keyed hash function. However, as it's exposed by HACL*, we test it.
180-
_EXPLICIT_HMAC_CONSTRUCTORS[HID.blake2s] = "_hmac.compute_blake2s_32"
181-
_EXPLICIT_HMAC_CONSTRUCTORS[HID.blake2b] = "_hmac.compute_blake2b_32"
180+
_EXPLICIT_HMAC_CONSTRUCTORS[HID.blake2s] = '_hmac.compute_blake2s_32'
181+
_EXPLICIT_HMAC_CONSTRUCTORS[HID.blake2b] = '_hmac.compute_blake2b_32'
182182
_EXPLICIT_HMAC_CONSTRUCTORS = MappingProxyType(_EXPLICIT_HMAC_CONSTRUCTORS)
183183
assert _EXPLICIT_HMAC_CONSTRUCTORS.keys() == CANONICAL_DIGEST_NAMES
184184

@@ -550,7 +550,6 @@ def find_gil_minsize(modules_names, default=2048):
550550
def _block_openssl_hash_new(blocked_name):
551551
"""Block OpenSSL implementation of _hashlib.new()."""
552552
assert isinstance(blocked_name, str), blocked_name
553-
554553
# re-import '_hashlib' in case it was mocked
555554
if (_hashlib := try_import_module("_hashlib")) is None:
556555
return contextlib.nullcontext()
@@ -599,8 +598,7 @@ def _block_builtin_hash_new(name):
599598
assert name.lower() == name, f"invalid name: {name}"
600599
assert name in HID, f"invalid hash: {name}"
601600

602-
# Re-import 'hashlib' in case it was mocked, but propagate
603-
# exceptions as it should be unconditionally available.
601+
# Re-import 'hashlib' in case it was mocked
604602
hashlib = importlib.import_module('hashlib')
605603
builtin_constructor_cache = getattr(hashlib, '__builtin_constructor_cache')
606604
builtin_constructor_cache_mock = builtin_constructor_cache.copy()

0 commit comments

Comments
 (0)