Skip to content

Commit a0fed9d

Browse files
fixes pylint warnings
1 parent 52ee72a commit a0fed9d

4 files changed

Lines changed: 16 additions & 44 deletions

File tree

src/wolfssl/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
# along with this program; if not, write to the Free Software
2121
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
2222

23+
# pylint: disable=too-many-instance-attributes, too-many-arguments
24+
# pylint: disable=too-many-arguments, too-many-branches, too-many-locals
25+
# pylint: disable=too-many-public-methods, too-many-statements
26+
2327
import sys
2428
import errno
2529
from socket import (
@@ -271,7 +275,8 @@ def __init__(self, sock=None, keyfile=None, certfile=None,
271275
proto=sock.proto,
272276
fileno=sock.fileno())
273277
else:
274-
socket.__init__(self, _sock=sock._sock)
278+
socket.__init__(
279+
self, _sock=sock._sock) # pylint: disable=protected-access
275280

276281
self.settimeout(sock.gettimeout())
277282

@@ -471,7 +476,7 @@ def unwrap(self):
471476

472477
return sock
473478

474-
def do_handshake(self, block=False):
479+
def do_handshake(self, block=False): # pylint: disable=unused-argument
475480
"""
476481
Perform a TLS/SSL handshake.
477482
"""

src/wolfssl/_memory.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/wolfssl/_methods.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@
2323
# pylint: disable=missing-docstring, invalid-name
2424

2525
try:
26-
from wolfssl._ffi import ffi as _ffi
2726
from wolfssl._ffi import lib as _lib
27+
from wolfssl._ffi import ffi as _ffi
2828
except ImportError:
2929
pass
3030

31-
from wolfssl._memory import (
32-
_native_free, _DYNAMIC_TYPE_METHOD
33-
)
34-
3531

3632
PROTOCOL_SSLv23 = 1
3733
PROTOCOL_SSLv3 = 2
@@ -43,8 +39,14 @@
4339
_PROTOCOL_LIST = [PROTOCOL_SSLv23, PROTOCOL_SSLv3, PROTOCOL_TLS,
4440
PROTOCOL_TLSv1, PROTOCOL_TLSv1_1, PROTOCOL_TLSv1_2]
4541

42+
_DYNAMIC_TYPE_METHOD = 11
43+
44+
45+
def _native_free(native_object, dynamic_type):
46+
_lib.wolfSSL_Free(native_object, _ffi.NULL, dynamic_type)
47+
4648

47-
class WolfSSLMethod(object):
49+
class WolfSSLMethod(object): # pylint: disable=too-few-public-methods
4850
"""
4951
An SSLMethod holds SSL-related configuration options such as
5052
protocol version and communication side.

tests/test_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ def test_load_verify_locations_with_cafile(ssl_context):
6969
ssl_context.load_verify_locations(cafile="certs/ca-cert.pem")
7070

7171

72-
def test_load_verify_locations_with_cadata(ssl_provider, ssl_context):
72+
def test_load_verify_locations_with_cadata(ssl_context):
7373
ssl_context.load_verify_locations(cadata=_CADATA)

0 commit comments

Comments
 (0)