From b50ebafa7913cf572ed1d4a87926b49f34fd2dc0 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Fri, 27 Aug 2021 10:54:27 -0700 Subject: [PATCH] Tighten return type of OpenSSL Connection.get_protocol_name() (#5972) The method always returns a str. See implementation at: https://github.com/pyca/pyopenssl/blob/30e82d4ba5e3817a77e212540477da701460e988/src/OpenSSL/SSL.py#L2420-L2430 If version were ever None, it would raise an exception on the .decode() line. --- stubs/pyOpenSSL/OpenSSL/SSL.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/pyOpenSSL/OpenSSL/SSL.pyi b/stubs/pyOpenSSL/OpenSSL/SSL.pyi index c9f284793..13b618ad3 100644 --- a/stubs/pyOpenSSL/OpenSSL/SSL.pyi +++ b/stubs/pyOpenSSL/OpenSSL/SSL.pyi @@ -131,7 +131,7 @@ class Connection(object): def get_peer_cert_chain(self) -> list[X509]: ... def get_alpn_proto_negotiated(self) -> bytes: ... def get_cipher_name(self) -> str | None: ... - def get_protocol_version_name(self) -> str | None: ... + def get_protocol_version_name(self) -> str: ... def get_shutdown(self) -> int: ... def get_app_data(self) -> Any: ... def set_app_data(self, data: Any) -> None: ...