fix: resolve pylint warnings

This commit is contained in:
Benoit Chesneau 2026-02-13 02:40:01 +01:00
parent 7486baa0ad
commit 6d81c9ebcd
6 changed files with 3 additions and 8 deletions

View File

@ -230,7 +230,7 @@ def format_all(data: dict) -> str:
return "\n".join(lines)
def format_response(command: str, data: dict) -> str:
def format_response(command: str, data: dict) -> str: # pylint: disable=too-many-return-statements
"""
Format response data based on command.

View File

@ -19,7 +19,6 @@ from gunicorn.ctl.protocol import (
class ControlClientError(Exception):
"""Control client error."""
pass
class ControlClient:

View File

@ -210,7 +210,6 @@ class CommandHandlers:
# Try to get socket family
try:
import socket
sock = lnr.sock
if sock.family == socket.AF_UNIX:
listener_info["type"] = "unix"
@ -523,8 +522,6 @@ class CommandHandlers:
Returns:
List of dirty worker info dicts, or empty list on error
"""
import socket
# Get socket path from arbiter object or environment
dirty_socket_path = None
if hasattr(self.arbiter, 'dirty_arbiter') and self.arbiter.dirty_arbiter:

View File

@ -26,7 +26,6 @@ import struct
class ProtocolError(Exception):
"""Protocol-level error."""
pass
class ControlProtocol:

View File

@ -204,7 +204,7 @@ class ControlSocketServer:
self.arbiter.log.exception("Command error")
return make_error_response(request_id, f"Command failed: {e}")
def _execute_command(self, parts: list) -> dict:
def _execute_command(self, parts: list) -> dict: # pylint: disable=too-many-return-statements
"""
Execute a parsed command.

View File

@ -573,7 +573,7 @@ class BinaryProtocol:
sock.sendall(data)
@staticmethod
def _encode_from_dict(message: dict) -> bytes:
def _encode_from_dict(message: dict) -> bytes: # pylint: disable=too-many-return-statements
"""
Encode a message dict to binary format.