Skip to content

Commit 9e77009

Browse files
pylint: compatibility workaround
Allow lint to not fail for all version from Python 3.6 latest one to python 3.10 latest one. See also [1]. 1. pylint-dev/pylint#3312 Part of #270
1 parent 4f613c7 commit 9e77009

File tree

7 files changed

+15
-11
lines changed

7 files changed

+15
-11
lines changed

.pylintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[MAIN]
2+
# Enable backward compatibility with pylint for pylint down to Python 3.6 one
3+
ignore=bad-option-value
4+
15
[BASIC]
26

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

tarantool/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ class Connection(ConnectionInterface):
489489
check its status, call procedures and evaluate Lua code on server,
490490
make simple data manipulations and execute SQL queries.
491491
"""
492-
# pylint: disable=too-many-instance-attributes,too-many-public-methods,no-self-use
492+
# pylint: disable=too-many-instance-attributes,too-many-public-methods,bad-option-value,no-self-use
493493

494494
# DBAPI Extension: supply exceptions as attributes on the connection
495495
Error = Error
@@ -1003,7 +1003,7 @@ def _ssl_load_cert_chain(self, context):
10031003
keyfile=self.ssl_key_file,
10041004
password=self.ssl_password)
10051005
return
1006-
except Exception as exc: # pylint: disable=broad-exception-caught
1006+
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
10071007
exc_list.append(exc)
10081008

10091009

@@ -1015,7 +1015,7 @@ def _ssl_load_cert_chain(self, context):
10151015
keyfile=self.ssl_key_file,
10161016
password=line.rstrip())
10171017
return
1018-
except Exception as exc: # pylint: disable=broad-exception-caught
1018+
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
10191019
exc_list.append(exc)
10201020

10211021

@@ -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
1032+
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
10331033
exc_list.append(exc)
10341034

10351035
raise SslError(exc_list)

tarantool/connection_pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class ConnectionPool(ConnectionInterface):
370370
>>> resp
371371
- ['AAAA', 'Alpha']
372372
"""
373-
# pylint: disable=too-many-public-methods,duplicate-code,no-self-use
373+
# pylint: disable=too-many-public-methods,duplicate-code,bad-option-value,no-self-use,super-init-not-called,bad-option-value
374374

375375
def __init__(self,
376376
addrs,
@@ -648,7 +648,7 @@ def _request_process_loop(self, key, unit, last_refresh):
648648
method = getattr(Connection, task.method_name)
649649
try:
650650
resp = method(unit.conn, *task.args, **task.kwargs)
651-
except Exception as exc: # pylint: disable=broad-exception-caught
651+
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
652652
unit.output_queue.put(exc)
653653
else:
654654
unit.output_queue.put(resp)

test/setup_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Test(setuptools.Command):
1717
"""
1818
Class implementing `python setup.py test`.
1919
"""
20-
# pylint: disable=no-self-use
20+
# pylint: disable=bad-option-value,no-self-use
2121

2222
user_options = []
2323
description = 'Run tests'

test/suites/test_encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def setUpClass(cls):
7373
def assertNotRaises(self, func, *args, **kwargs):
7474
try:
7575
func(*args, **kwargs)
76-
except Exception as exc: # pylint: disable=broad-exception-caught
76+
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
7777
self.fail(f'Function raised Exception: {repr(exc)}')
7878

7979
def setUp(self):

test/suites/test_pool.py

Lines changed: 2 additions & 2 deletions
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,no-self-use
5+
# pylint: disable=missing-class-docstring,missing-function-docstring,too-many-public-methods,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
72+
except Exception as exc: # pylint: disable=broad-exception-caught,broad-except
7373
if i + 1 == count:
7474
raise exc
7575

test/suites/test_ssl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
This module tests connection through SSL.
33
"""
4-
# pylint: disable=missing-class-docstring,missing-function-docstring,too-many-branches,too-many-locals,no-self-use
4+
# pylint: disable=missing-class-docstring,missing-function-docstring,too-many-branches,too-many-locals,bad-option-value,no-self-use
55

66
import os
77
import sys

0 commit comments

Comments
 (0)