From e8aeb7f9f66b0766eda4e2d8a66c4f16e3afed14 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@henrietta.com.pl>
Date: Tue, 5 Mar 2024 17:22:18 +0100
Subject: [PATCH] fix pylint

---
 pyproject.toml                                       |  4 +++-
 .../instrumentation/metrics/structures/threadpool.py | 12 ++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index a7cf89b0..e36cb71e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -38,6 +38,8 @@ extras = ["requests","pyyaml","toml", "ujson", "cassandra-driver", "opentracing"
 requires = ["setuptools", "setuptools-scm"]
 build-backend = "setuptools.build_meta"
 
+[tool.pep8]
+max-line-length = 119
 
 [project.urls]
 Homepage = "https://github.com/piotrmaslanka/satella"
@@ -84,7 +86,7 @@ log_cli = true
 [tool.pylint.format]
 max-line-length = 120
 
-[tool.pylint.MASTER]
+[tool.pylint."MESSAGES CONTROL"]
 disable = '''
     missing-module-docstring,
     missing-class-docstring,
diff --git a/satella/instrumentation/metrics/structures/threadpool.py b/satella/instrumentation/metrics/structures/threadpool.py
index c0fa4225..356bcdc1 100644
--- a/satella/instrumentation/metrics/structures/threadpool.py
+++ b/satella/instrumentation/metrics/structures/threadpool.py
@@ -21,11 +21,11 @@ def _worker(executor_reference, work_queue, initializer, initargs):
     if initializer is not None:
         try:
             initializer(*initargs)
-        except BaseException:
+        except BaseException:       # pylint: disable=broad-exception-caught
             _base.LOGGER.critical('Exception in initializer:', exc_info=True)
             executor = executor_reference()
             if executor is not None:
-                executor._initializer_failed()
+                executor._initializer_failed()          # pylint: disable=protected-access
             return
     try:
         while True:
@@ -48,7 +48,7 @@ def _worker(executor_reference, work_queue, initializer, initargs):
                 # attempt to increment idle count
 
                 if executor is not None:
-                    executor._idle_semaphore.release()
+                    executor._idle_semaphore.release()      # pylint: disable=protected-access
                 del executor
                 continue
 
@@ -57,11 +57,11 @@ def _worker(executor_reference, work_queue, initializer, initargs):
             #   - The interpreter is shutting down OR
             #   - The executor that owns the worker has been collected OR
             #   - The executor that owns the worker has been shutdown.
-            if thread._shutdown or executor is None or executor._shutdown:
+            if thread._shutdown or executor is None or executor._shutdown:  # pylint: disable=protected-access
                 # Flag the executor as shutting down as early as possible if it
                 # is not gc-ed yet.
                 if executor is not None:
-                    executor._shutdown = True
+                    executor._shutdown = True       # pylint: disable=protected-access
                 # Notice other workers
                 work_queue.put(None)
                 return
@@ -136,7 +136,7 @@ class MetrifiedThreadPoolExecutor(ThreadPoolExecutor):
 
             if self._shutdown:
                 raise RuntimeError('cannot schedule new futures after shutdown')
-            if thread._shutdown:
+            if thread._shutdown:            # pylint: disable=protected-access
                 raise RuntimeError('cannot schedule new futures after '
                                    'interpreter shutdown')
 
-- 
GitLab