Skip to content

Commit 4356906

Browse files
committed
explicitly require to pass exclude=... to avoid confusions
1 parent a80ad5c commit 4356906

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Lib/test/support/hashlib_helper.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -717,12 +717,12 @@ def requires_builtin_hashdigest(canonical_name, *, usedforsecurity=True):
717717
)
718718

719719

720-
def requires_builtin_hashes(*ignored, usedforsecurity=True):
720+
def requires_builtin_hashes(*, exclude=(), usedforsecurity=True):
721721
"""Decorator raising SkipTest if one HACL* hashing algorithm is missing."""
722722
return _chain_decorators((
723723
_make_requires_builtin_hashdigest_decorator(
724724
info.builtin, usedforsecurity=usedforsecurity
725-
) for info in _iter_hash_func_info(ignored)
725+
) for info in _iter_hash_func_info(exclude)
726726
))
727727

728728

@@ -1058,18 +1058,18 @@ def block_algorithm(name, *, allow_openssl=False, allow_builtin=False):
10581058

10591059

10601060
@contextlib.contextmanager
1061-
def block_openssl_algorithms(*ignored):
1062-
"""Block OpenSSL implementations, except those given in *ignored*."""
1061+
def block_openssl_algorithms(*, exclude=()):
1062+
"""Block OpenSSL implementations, except those given in *exclude*."""
10631063
with contextlib.ExitStack() as stack:
1064-
for name in CANONICAL_DIGEST_NAMES.difference(ignored):
1064+
for name in CANONICAL_DIGEST_NAMES.difference(exclude):
10651065
stack.enter_context(block_algorithm(name, allow_builtin=True))
10661066
yield
10671067

10681068

10691069
@contextlib.contextmanager
1070-
def block_builtin_algorithms(*ignored):
1071-
"""Block HACL* implementations, except those given in *ignored*."""
1070+
def block_builtin_algorithms(*, exclude=()):
1071+
"""Block HACL* implementations, except those given in *exclude*."""
10721072
with contextlib.ExitStack() as stack:
1073-
for name in CANONICAL_DIGEST_NAMES.difference(ignored):
1073+
for name in CANONICAL_DIGEST_NAMES.difference(exclude):
10741074
stack.enter_context(block_algorithm(name, allow_openssl=True))
10751075
yield

0 commit comments

Comments
 (0)