Skip to content

Commit 0c4f553

Browse files
pylint: fix remaining compatibility issues
See [1] about global bad-option-value fail to work. 1. pylint-dev/pylint#3312 Part of #270
1 parent 8851e3d commit 0c4f553

File tree

10 files changed

+16
-17
lines changed

10 files changed

+16
-17
lines changed

.pylintrc

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[MAIN]
2-
# Enable backward compatibility with pylint for pylint down to Python 3.6 one
3-
ignore=bad-option-value
4-
51
[BASIC]
62

73
# Good variable names which should always be accepted, separated by a comma

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""
33
Package setup commands.
44
"""
5+
# pylint: disable=bad-option-value,too-many-ancestors
56

67
import codecs
78
import os

tarantool/connection.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
This module provides API for interaction with a Tarantool server.
33
"""
4-
# pylint: disable=too-many-lines
4+
# pylint: disable=too-many-lines,duplicate-code
55

66
import os
77
import time
@@ -1005,7 +1005,7 @@ def _ssl_load_cert_chain(self, context):
10051005
keyfile=self.ssl_key_file,
10061006
password=self.ssl_password)
10071007
return
1008-
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
1008+
except Exception as exc: # pylint: disable=bad-option-value,broad-exception-caught,broad-except
10091009
exc_list.append(exc)
10101010

10111011
if self.ssl_password_file is not None:
@@ -1016,7 +1016,7 @@ def _ssl_load_cert_chain(self, context):
10161016
keyfile=self.ssl_key_file,
10171017
password=line.rstrip())
10181018
return
1019-
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
1019+
except Exception as exc: # pylint: disable=bad-option-value,broad-exception-caught,broad-except
10201020
exc_list.append(exc)
10211021

10221022
try:
@@ -1029,7 +1029,7 @@ def password_raise_error():
10291029
password=password_raise_error)
10301030

10311031
return
1032-
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
1032+
except Exception as exc: # pylint: disable=bad-option-value,broad-exception-caught,broad-except
10331033
exc_list.append(exc)
10341034

10351035
raise SslError(exc_list)

tarantool/connection_pool.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
This module provides API for interaction with Tarantool servers cluster.
33
"""
4-
# pylint: disable=too-many-lines
4+
# pylint: disable=too-many-lines,duplicate-code
55

66
import abc
77
import itertools
@@ -210,6 +210,7 @@ class RoundRobinStrategy(StrategyInterface):
210210
"""
211211
Simple round-robin pool servers rotation.
212212
"""
213+
# pylint: disable=bad-option-value,no-self-use
213214

214215
def __init__(self, pool):
215216
"""
@@ -372,7 +373,7 @@ class ConnectionPool(ConnectionInterface):
372373
>>> resp
373374
- ['AAAA', 'Alpha']
374375
"""
375-
# pylint: disable=too-many-public-methods,duplicate-code,bad-option-value,no-self-use,super-init-not-called,bad-option-value
376+
# pylint: disable=too-many-public-methods,duplicate-code,bad-option-value,no-self-use
376377

377378
def __init__(self,
378379
addrs,
@@ -652,7 +653,7 @@ def _request_process_loop(self, key, unit, last_refresh):
652653
method = getattr(Connection, task.method_name)
653654
try:
654655
resp = method(unit.conn, *task.args, **task.kwargs)
655-
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
656+
except Exception as exc: # pylint: disable=bad-option-value,broad-exception-caught,broad-except
656657
unit.output_queue.put(exc)
657658
else:
658659
unit.output_queue.put(resp)

tarantool/dbapi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
.. _PEP-249: http://www.python.org/dev/peps/pep-0249/
55
"""
6-
# pylint: disable=fixme,unused-import
6+
# pylint: disable=fixme,unused-import,bad-option-value,no-self-use
77
# flake8: noqa: F401
88

99
from tarantool.connection import Connection as BaseConnection

tarantool/mesh_connection.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
This module provides API for interaction with Tarantool servers cluster.
33
"""
4-
# pylint: disable=fixme
4+
# pylint: disable=fixme,duplicate-code
55

66
import time
77

@@ -267,7 +267,6 @@ class MeshConnection(Connection):
267267
"""
268268
Represents a connection to a cluster of Tarantool servers.
269269
"""
270-
# pylint: disable=duplicate-code
271270

272271
def __init__(self, host=None, port=None,
273272
user=None,

tarantool/msgpack_ext/packer.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
.. _extension: https://www.tarantool.io/en/doc/latest/dev_guide/internals/msgpack_extensions/
55
"""
6+
# pylint: disable=duplicate-code
67

78
from decimal import Decimal
89
from uuid import UUID

tarantool/msgpack_ext/unpacker.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
.. _extension: https://www.tarantool.io/en/doc/latest/dev_guide/internals/msgpack_extensions/
55
"""
6+
# pylint: disable=duplicate-code
67

78
import tarantool.msgpack_ext.decimal as ext_decimal
89
import tarantool.msgpack_ext.uuid as ext_uuid

test/suites/test_encoding.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def setUpClass(cls):
7474
def assertNotRaises(self, func, *args, **kwargs):
7575
try:
7676
func(*args, **kwargs)
77-
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
77+
except Exception as exc: # pylint: disable=bad-option-value,broad-exception-caught,broad-except
7878
self.fail(f'Function raised Exception: {repr(exc)}')
7979

8080
def setUp(self):

test/suites/test_pool.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This module tests work with a cluster of Tarantool servers through
33
ConnectionPool.
44
"""
5-
# pylint: disable=missing-class-docstring,missing-function-docstring,too-many-public-methods,duplicate-code,bad-option-value,no-self-use
5+
# pylint: disable=missing-class-docstring,missing-function-docstring,too-many-public-methods,too-many-locals,duplicate-code,bad-option-value,no-self-use
66

77
import sys
88
import time
@@ -69,7 +69,7 @@ def retry(self, func, count=5, timeout=0.5):
6969
for i in range(count):
7070
try:
7171
func()
72-
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
72+
except Exception as exc: # pylint: disable=bad-option-value,broad-exception-caught,broad-except
7373
if i + 1 == count:
7474
raise exc
7575

0 commit comments

Comments
 (0)