From e4dd7c452b4eb01c65701178f1ce04ecfd60e07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Tue, 28 Mar 2023 22:31:14 +0200 Subject: Fix mypy problems --- src/M2Crypto/ASN1.py | 3 ++- src/M2Crypto/EC.py | 4 ++-- src/M2Crypto/SSL/Connection.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/M2Crypto/ASN1.py b/src/M2Crypto/ASN1.py index b29326a..424945d 100644 --- a/src/M2Crypto/ASN1.py +++ b/src/M2Crypto/ASN1.py @@ -182,7 +182,8 @@ class ASN1_TIME(object): self.asn1_time = asn1_time self._pyfree = _pyfree else: - self.asn1_time = m2.asn1_time_new() # type: bytes (ASN1_TIME*) + # that's (ASN1_TIME*) + self.asn1_time = m2.asn1_time_new() # type: bytes self._pyfree = 1 def __del__(self): diff --git a/src/M2Crypto/EC.py b/src/M2Crypto/EC.py index 8cd052a..2e74267 100644 --- a/src/M2Crypto/EC.py +++ b/src/M2Crypto/EC.py @@ -10,7 +10,7 @@ Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved.""" -from M2Crypto import BIO, Err, EVP, m2, util +from M2Crypto import BIO, Err, EC, EVP, m2, util from typing import AnyStr, Callable, Dict, Optional, Tuple, Union # noqa EC_Key = bytes @@ -411,7 +411,7 @@ def load_pub_key(file): def load_key_string_pubkey(string, callback=util.passphrase_callback): - # type: (str, Callable) -> PKey + # type: (str, Callable) -> EC.PKey """ Load an M2Crypto.EC.PKey from a public key as a string. diff --git a/src/M2Crypto/SSL/Connection.py b/src/M2Crypto/SSL/Connection.py index c5693c9..62a661e 100644 --- a/src/M2Crypto/SSL/Connection.py +++ b/src/M2Crypto/SSL/Connection.py @@ -101,10 +101,10 @@ class Connection(object): self._free_bio() def close(self, freeBio=False): + # type: (Optional[bool]) -> None """ if freeBio is true, call _free_bio """ - # type: () -> None m2.ssl_shutdown(self.ssl) if freeBio: self._free_bio() -- cgit v1.2.1