diff --git a/stdlib/hmac.pyi b/stdlib/hmac.pyi index b9a867f7b..ee8af1b48 100644 --- a/stdlib/hmac.pyi +++ b/stdlib/hmac.pyi @@ -30,7 +30,13 @@ class HMAC: block_size: int @property def name(self) -> str: ... - def __init__(self, key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod = "") -> None: ... + if sys.version_info >= (3, 8): + def __init__(self, key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod = "") -> None: ... + else: + def __init__( + self, key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod | None = None + ) -> None: ... + def update(self, msg: ReadableBuffer) -> None: ... def digest(self) -> bytes: ... def hexdigest(self) -> str: ... diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index 3c9a5357e..f83cd84b6 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -32,7 +32,6 @@ dummy_threading.Condition.release dummy_threading.Event.isSet dummy_threading.local.__new__ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve -hmac.HMAC.__init__ inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this inspect.Signature.from_function # Removed in 3.11, can add if someone needs this ipaddress._BaseNetwork.__init__