Fix and enable lint no-self-use & try-except-raise.

This commit is contained in:
Jonathan Moody 2022-06-16 08:52:40 -04:00 committed by Lex Berezhny
parent c8a3eb97a4
commit 7a86406746
5 changed files with 6 additions and 5 deletions

View file

@ -37,7 +37,7 @@ class Component(metaclass=ComponentType):
def running(self):
return self._running
async def get_status(self):
async def get_status(self): # pylint: disable=no-self-use
return
async def start(self):

View file

@ -614,7 +614,8 @@ class Daemon(metaclass=JSONRPCServerType):
content_type='application/json'
)
async def handle_metrics_get_request(self, request: web.Request):
@staticmethod
async def handle_metrics_get_request(request: web.Request):
try:
return web.Response(
text=prom_generate_latest().decode(),

View file

@ -23,6 +23,7 @@ class BackgroundDownloader:
except ValueError:
return
except asyncio.CancelledError:
log.debug("Cancelled background downloader")
raise
except Exception:
log.error("Unexpected download error on background downloader")

View file

@ -224,7 +224,8 @@ class StreamManager(SourceManager):
)
return task
async def _retriable_reflect_stream(self, stream, host, port):
@staticmethod
async def _retriable_reflect_stream(stream, host, port):
sent = await stream.upload_to_reflector(host, port)
while not stream.is_fully_reflected and stream.reflector_progress > 0 and len(sent) > 0:
stream.reflector_progress = 0

View file

@ -29,8 +29,6 @@ disable=
cyclic-import,
missing-docstring,
consider-using-f-string,
no-self-use,
try-except-raise,
duplicate-code,
expression-not-assigned,
inconsistent-return-statements,